<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to get Button Box Script to have evaluated expression in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-Button-Box-Script-to-have-evaluated-expression/m-p/914974#M107526</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to create an automated addition of button boxes that will script point to individual Outline Boxes (as an example with Scroll Window or close) - I manage to get the expression built through a For loop that inserts the name of the script items in the list successfully, but when I go to have the button boxes each have a unique script, they instead hold the name of the expression 'buttonclickexpr' as the script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I get the script in the expression evaluated and placed correctly as a written command that the button box will run on click?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//an example of how the window could appear
report_win=new window("test", content_VLB=V List Box(), Outline Box("Example: Distribution"), Outline Box("Example: Multivariate"));

//example of the variable that would store the name of scripts that created the OBs
script_new={"Distribution", "Multivariate", "Profiler"};

//the for loop to correctly setup the expression with the correct section name and add a button
For( i = 1, i &amp;lt;= N Items( script_new ), i++,
    buttonclickexpr = Expr(
        report_win &amp;lt;&amp;lt; Scroll Window(
            report_win[Outline Box( sectionName)]
        )
    );
   Substitute Into( buttonclickexpr, Expr(sectionName), Char("Example: " ||script_new[i]) );
	
	write(buttonclickexpr);
    // Add a button to the list
   content_VLB&amp;lt;&amp;lt;append(
        Button Box( "Go to " || script_new[i], buttonclickexpr )
    );
    );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Nov 2025 15:26:38 GMT</pubDate>
    <dc:creator>RahBarroso</dc:creator>
    <dc:date>2025-11-24T15:26:38Z</dc:date>
    <item>
      <title>How to get Button Box Script to have evaluated expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-Button-Box-Script-to-have-evaluated-expression/m-p/914974#M107526</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to create an automated addition of button boxes that will script point to individual Outline Boxes (as an example with Scroll Window or close) - I manage to get the expression built through a For loop that inserts the name of the script items in the list successfully, but when I go to have the button boxes each have a unique script, they instead hold the name of the expression 'buttonclickexpr' as the script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I get the script in the expression evaluated and placed correctly as a written command that the button box will run on click?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//an example of how the window could appear
report_win=new window("test", content_VLB=V List Box(), Outline Box("Example: Distribution"), Outline Box("Example: Multivariate"));

//example of the variable that would store the name of scripts that created the OBs
script_new={"Distribution", "Multivariate", "Profiler"};

//the for loop to correctly setup the expression with the correct section name and add a button
For( i = 1, i &amp;lt;= N Items( script_new ), i++,
    buttonclickexpr = Expr(
        report_win &amp;lt;&amp;lt; Scroll Window(
            report_win[Outline Box( sectionName)]
        )
    );
   Substitute Into( buttonclickexpr, Expr(sectionName), Char("Example: " ||script_new[i]) );
	
	write(buttonclickexpr);
    // Add a button to the list
   content_VLB&amp;lt;&amp;lt;append(
        Button Box( "Go to " || script_new[i], buttonclickexpr )
    );
    );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 15:26:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-Button-Box-Script-to-have-evaluated-expression/m-p/914974#M107526</guid>
      <dc:creator>RahBarroso</dc:creator>
      <dc:date>2025-11-24T15:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Button Box Script to have evaluated expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-Button-Box-Script-to-have-evaluated-expression/m-p/914986#M107527</link>
      <description>&lt;P&gt;you can use Eval(Eval Expr()).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//an example of how the window could appear
report_win = New Window( "test",
	content_VLB = V List Box(),
	Scroll box (Size(20,1500)),
	Outline Box( "Example: Distribution" ),
	Scroll box (Size(20,1500)),
	Outline Box( "Example: Multivariate" )
);

//example of the variable that would store the name of scripts that created the OBs
script_new = {"Distribution", "Multivariate", "Profiler"};

//the for loop to correctly setup the expression with the correct section name and add a button
For( i = 1, i &amp;lt;= N Items( script_new ), i++,
	buttonclickexpr = Expr(
	report_win &amp;lt;&amp;lt; Scroll Window( report_win[sectionName ] );
		Caption(sectionName)
	);
	Substitute Into( buttonclickexpr, Expr( sectionName ), Char( "Example: " || script_new[i] ) );
	
	Write( buttonclickexpr );
    // Add a button to the list
	Eval (Eval Expr(content_VLB &amp;lt;&amp;lt; append( Button Box( "Go to " || script_new[i], Expr(Name Expr(buttonclickexpr))))  ));
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In &lt;FONT face="courier new,courier"&gt;OutlineBox("tag")&lt;/FONT&gt;, the tag is the HelperKey of the OutlineBox. To access the Outline box via the title, you can directly use the title [without &lt;FONT face="courier new,courier"&gt;OutlineBox()&lt;/FONT&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Details can be found in&amp;nbsp;&lt;LI-MESSAGE title="Re: Expression Handling in JMP: Tipps and Trapdoors" uid="826252" url="https://community.jmp.com/t5/Discussions/Expression-Handling-in-JMP-Tips-and-Trapdoors/m-p/826252#U826252" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="17px"&gt;&lt;FONT face="arial black,avant garde"&gt;use&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="50%" height="17px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="20px"&gt;&lt;FONT face="courier new,courier"&gt;Name Expr()&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="50%" height="20px"&gt;... to retrieve the expression that is stored in the name&amp;nbsp;&lt;CODE class=" language-jsl"&gt;buttonclickexpr&lt;/CODE&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="17px"&gt;&lt;FONT face="courier new,courier"&gt;Expr()&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="50%" height="17px"&gt;... to mark the code - such that &lt;FONT face="courier new,courier"&gt;Eval Expr()&lt;/FONT&gt; can find it&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="17px"&gt;&lt;FONT face="courier new,courier"&gt;Eval Expr()&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="50%" height="17px"&gt;... to find &lt;FONT face="courier new,courier"&gt;Expr()&lt;/FONT&gt; and evaluate it&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="17px"&gt;&lt;FONT face="courier new,courier"&gt;Eval()&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD height="17px"&gt;... to evaluate the whole expression after the previous steps.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 24 Nov 2025 17:42:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-Button-Box-Script-to-have-evaluated-expression/m-p/914986#M107527</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-11-24T17:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get Button Box Script to have evaluated expression</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-Button-Box-Script-to-have-evaluated-expression/m-p/915028#M107532</link>
      <description>&lt;P&gt;An alternative approach : &lt;FONT face="courier new,courier"&gt;Substitute()&lt;/FONT&gt;&lt;BR /&gt;[already used to adjust the &lt;FONT face="courier new,courier"&gt;buttonclickexpr *)]&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Both steps on one:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For each ({title}, script_new ,
	myExpr = Expr(
	content_VLB &amp;lt;&amp;lt; append( Button Box( "Go to " || title,current report() &amp;lt;&amp;lt; Scroll Window( current report()[_sectionName_ ] )));
	);
	Eval(Substitute (Name Expr(myExpr), Expr( _sectionName_ ),  "Example: " || title ));
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="17px"&gt;&lt;FONT face="arial black,avant garde"&gt;use&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="50%" height="17px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="29px"&gt;&lt;FONT face="courier new,courier"&gt;Substitute()&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="50%" height="29px"&gt;... like Substitute for String - but keep in mind that the arguments get evaluated! This is why you have to use ...&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;FONT face="courier new,courier"&gt;Name Expr()&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD&gt;... to retrieve the expression that is stored in the name &lt;FONT face="courier new,courier"&gt;myExpr&lt;/FONT&gt; &lt;BR /&gt;- without evaluating it!!!&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="20px"&gt;&lt;FONT face="courier new,courier"&gt;Expr()&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="50%" height="20px"&gt;... to protect &lt;CODE class=" language-jsl"&gt;_sectionName_ &lt;/CODE&gt;from getting evaluated&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="17px"&gt;&lt;FONT face="courier new,courier"&gt;Eval()&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD height="17px"&gt;... to evaluate the whole expression after the previous steps.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*) Other than Substitute. &lt;FONT face="courier new,courier"&gt;Substitute Into()&lt;/FONT&gt; does not&amp;nbsp; evaluate its first argument.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 18:06:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-Button-Box-Script-to-have-evaluated-expression/m-p/915028#M107532</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-11-24T18:06:55Z</dc:date>
    </item>
  </channel>
</rss>

