<?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: Call function in checkbox in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Call-function-in-checkbox/m-p/416667#M66586</link>
    <description>&lt;P&gt;You are using the index "i" for all of your For() loops.&amp;nbsp; That means that the value of "i" is getting changed all over the place.&amp;nbsp; You need to use different variables for your For() loops when there is a loop within a loop.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Sep 2021 00:12:56 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-09-09T00:12:56Z</dc:date>
    <item>
      <title>Call function in checkbox</title>
      <link>https://community.jmp.com/t5/Discussions/Call-function-in-checkbox/m-p/416428#M66572</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am building a simple interface for the user and have a window to set some options using check boxes.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am currently able to make the first call function and the script filters the string "SE" from the columns and generates outliers. However, if I check 2nd and 3rd checkbox it does not call the function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;I tried the following script:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Water Treatment.jmp");

check_list = {"SS", "SE", "PH"};

todo_list  = {};


nw = new window("Checkboxes", &amp;lt;&amp;lt; modal(),

     my_cb = checkbox(check_list),

     panelbox("Actions",

           hlistbox(

                button box("OK",

                     keep_going = 1;

                     todo_list = my_cb &amp;lt;&amp;lt; get selected;

                ),

                button box("Cancel", keep_going = 0)

           ),

     ),

);

nt = nitems(todo_list);
colList = dt &amp;lt;&amp;lt; Get Column Names("String");
filteredCols = {};


if (keep_going &amp;amp; nt &amp;gt; 0,

     for (i = 1, i &amp;lt;= nt, i++,

           if (todo_list[i] == "SS",

//              Call function for One step

For(i = 1, i &amp;lt;= N Items(colList), i++,
	If(Contains(colList[i], "SS"), Insert Into(filteredCols, colList[i]))
);
obj = dt &amp;lt;&amp;lt;
Explore Outliers(
	Y((Eval(filteredCols) )));

obj &amp;lt;&amp;lt; Quantile Range Outliers;
obj &amp;lt;&amp;lt; Select Rows(All);
                ,

                todo_list[i] == "SE",

//              Call function for Two step

               For(i = 1, i &amp;lt;= N Items(colList), i++,
	If(Contains(colList[i], "SE"), Insert Into(filteredCols, colList[i]))
);
obj = dt &amp;lt;&amp;lt;
Explore Outliers(
	Y((Eval(filteredCols) )));

obj &amp;lt;&amp;lt; Quantile Range Outliers;
obj &amp;lt;&amp;lt; Select Rows(All);
				,
				todo_list[i] == "PH",

//              Call function for Three step

               For(i = 1, i &amp;lt;= N Items(colList), i++,
	If(Contains(colList[i], "PH"), Insert Into(filteredCols, colList[i]))
);
obj = dt &amp;lt;&amp;lt;
Explore Outliers(
	Y((Eval(filteredCols) )));

obj &amp;lt;&amp;lt; Quantile Range Outliers;
obj &amp;lt;&amp;lt; Select Rows(All);


           );

     );

);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Looking for some&amp;nbsp;&lt;/SPAN&gt;feedback&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jack&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:56:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Call-function-in-checkbox/m-p/416428#M66572</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2023-06-09T19:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Call function in checkbox</title>
      <link>https://community.jmp.com/t5/Discussions/Call-function-in-checkbox/m-p/416667#M66586</link>
      <description>&lt;P&gt;You are using the index "i" for all of your For() loops.&amp;nbsp; That means that the value of "i" is getting changed all over the place.&amp;nbsp; You need to use different variables for your For() loops when there is a loop within a loop.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 00:12:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Call-function-in-checkbox/m-p/416667#M66586</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-09T00:12:56Z</dc:date>
    </item>
  </channel>
</rss>

