<?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 Re: How to generate buttons within a loop? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9824#M9610</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an implementation that works.&amp;nbsp; I changed the distribution expression to a function, and then had to play with evalinsert, parse, eval to get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;showdistribution &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;function&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;({&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;column_name&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;Default Local&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_expr &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;evalinsert&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"\[Distribution( Nominal Distribution( column(:name("^column_name^")) ) )]\"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;eval&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;parse&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;dist_expr&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green;"&gt;// Main Window&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;New Window&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Main Window"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp; ob &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;OutlineBox&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Buttons"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;TextBox&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Debugging buttons"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Set Font Style&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Bold"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green;"&gt;// Create button that only outputs to log&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;BB &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;Button Box&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"ClickMe"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;Show&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Clicked"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;))&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;ob &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;Append&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;BB&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;open&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"$sample_data\Big Class.jmp"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;dtcols &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; dt &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;get column names&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;string&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;i &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; i &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;nitems&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;dtcols&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; i&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; button_expr &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;evalinsert&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"\[one_button = button box("^dtcols&lt;I&gt;^", showdistribution("^dtcols&lt;I&gt;^"))]\"&lt;/I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;eval&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;parse&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;button_expr&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ob &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;append&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;one_button&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Oct 2014 12:31:59 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2014-10-13T12:31:59Z</dc:date>
    <item>
      <title>How to generate buttons within a loop?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9823#M9609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to generate buttons within a loop (one button for each column). The buttons are created correctly except that when the button executes its script it will always execute the script of the lastly created button - instead of the script that was passed to the button box object when it was created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, it seems that the button gets only a reference to the script - and if script is changed the button will change its function. I tried considering workaround with array of scripts but the problem is that I can't pass any argument for the button object (e.g. index which script in the array to execute).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question: Is there any way in jsl that one can create buttons within a loop with different scripts/behaviour? E.g. is there any way of passing arguments/data to button object when it is created???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NamesDefaultToHere(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;dt = Current Data Table(); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;dtCols = dt &amp;lt;&amp;lt; Get Column Names( Numeric, Continuous );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Expression for displaying distribution for strParam&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Expr_ShowDistribution = Expr(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; New Window( Char(strParam),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Distribution(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Continuous Distribution(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Column( strParam ) //We specify our parameter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SendToReport( &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dispatch( {}, "Distribution", OutlineBox, Set Title( "" ) ), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Main Window&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;New Window("Main Window",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; ob = OutlineBox("Buttons",&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextBox("Debugging buttons", Set Font Style("Bold"))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Create button that only outputs to log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;BB = Button Box( "ClickMe", Show("Clicked"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ob &amp;lt;&amp;lt; Append(BB);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;// Create buttons for showing distributions&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;For( i = 1, i &amp;lt;= NItems(dtCols), i++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Expr_ButtonAction = Substitute(NameExpr(Expr_ShowDistribution), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Expr(strParam), Eval(Char(dtCols&lt;I&gt;)) );&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Show(NameExpr(Expr_ButtonAction)); // Expression is different for each button.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; BB = Button Box( Char(dtCols&lt;I&gt;), Eval(Expr_ButtonAction));&lt;/I&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; ob &amp;lt;&amp;lt; Append(BB);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Oct 2014 06:42:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9823#M9609</guid>
      <dc:creator>juha_wikstroem</dc:creator>
      <dc:date>2014-10-12T06:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate buttons within a loop?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9824#M9610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an implementation that works.&amp;nbsp; I changed the distribution expression to a function, and then had to play with evalinsert, parse, eval to get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;showdistribution &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;function&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;({&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;column_name&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;Default Local&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_expr &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;evalinsert&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"\[Distribution( Nominal Distribution( column(:name("^column_name^")) ) )]\"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;eval&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;parse&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;dist_expr&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green;"&gt;// Main Window&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;New Window&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Main Window"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp; ob &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;OutlineBox&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Buttons"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;TextBox&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Debugging buttons"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; Set Font Style&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Bold"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: green;"&gt;// Create button that only outputs to log&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;BB &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;Button Box&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"ClickMe"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;Show&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"Clicked"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;))&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;ob &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;Append&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;BB&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;open&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"$sample_data\Big Class.jmp"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;dtcols &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; dt &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;get column names&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;string&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;i &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; i &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;nitems&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;dtcols&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; i&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; button_expr &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;evalinsert&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple;"&gt;"\[one_button = button box("^dtcols&lt;I&gt;^", showdistribution("^dtcols&lt;I&gt;^"))]\"&lt;/I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;eval&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd;"&gt;parse&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;button_expr&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ob &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;append&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;one_button&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 12:31:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9824#M9610</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2014-10-13T12:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate buttons within a loop?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9825#M9611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A button script can be a function with a "this" parameter that refers to the button, which means the button can find its name or its parent box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New Window( "example", v = V List Box() );&lt;/P&gt;&lt;P&gt;f = Function( {this}, Show( this &amp;lt;&amp;lt; getbuttonname ) );&lt;/P&gt;&lt;P&gt;For( i = 1, i &amp;lt; 10, i++,&lt;/P&gt;&lt;P&gt;&amp;nbsp; v &amp;lt;&amp;lt; append( Button Box( "number " || Char( i ), Set Function( f ) ) )&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="7422_Buttons.PNG" style="width: 665px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/889i9D5517279763D0FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="7422_Buttons.PNG" alt="7422_Buttons.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The "Set Function" parameter is the key to making this work.&amp;nbsp; In your example I think the button names might be the column names.&amp;nbsp; The VListBox in the example is named "v" so button boxes can be appended to it.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2016 21:50:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9825#M9611</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2016-10-18T21:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate buttons within a loop?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9826#M9612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;STRONG&gt;Set Function()&lt;/STRONG&gt; approach would seem to be more useful if I could attach some user data to the button, say by adding key-value pairs to an associative array.&amp;nbsp; Is that possible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 18:45:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9826#M9612</guid>
      <dc:creator>Eric_Hill</dc:creator>
      <dc:date>2014-10-13T18:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate buttons within a loop?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9827#M9613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good idea, but not implemented.&amp;nbsp; For now I'd suggest using the button's name as the key to an associative array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 19:10:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9827#M9613</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2014-10-13T19:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate buttons within a loop?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9828#M9614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your example should work if the last two rows within the loop, i.e&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier;"&gt;BB &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Button Box&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #032ce4;"&gt;Char&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;dtCols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;])&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Eval&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;Expr_ButtonAction&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 14px; font-family: Courier;"&gt;&amp;nbsp; ob &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;Append&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;BB&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are replaced with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #032ce4;"&gt;Eval&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #032ce4;"&gt;Eval Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; ob &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;Append&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #032ce4;"&gt;Button Box&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #032ce4;"&gt;Char&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; dtCols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #032ce4;"&gt;Name Expr&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; Expr_ButtonAction &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not the most obvious solution. Here, I think the "string manipulation" approach like in PMroz' example is simpler.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 23:54:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-generate-buttons-within-a-loop/m-p/9828#M9614</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2014-10-13T23:54:50Z</dc:date>
    </item>
  </channel>
</rss>

