<?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: get a list as variable for a script from a dialog box in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/get-a-list-as-variable-for-a-script-from-a-dialog-box/m-p/190589#M40931</link>
    <description>&lt;P&gt;You're almost there.&amp;nbsp; &lt;STRONG&gt;list_xrf&lt;/STRONG&gt; refers to a display object and is not a list.&amp;nbsp; You have to get the list when the OK button is pushed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;m = n = o = p = "";
New Window( "Define Pad types",
	&amp;lt;&amp;lt; Modal,
	&amp;lt;&amp;lt; Return Result,
	Outline Box( "Please define", Table Box(pad_sceb = String Col Edit Box( "Pad types", {m, n, o, p} ) ) ),
	button box("OK",
		list_XRF = pad_sceb &amp;lt;&amp;lt; get;
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 01 Apr 2019 13:28:35 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2019-04-01T13:28:35Z</dc:date>
    <item>
      <title>get a list as variable for a script from a dialog box</title>
      <link>https://community.jmp.com/t5/Discussions/get-a-list-as-variable-for-a-script-from-a-dialog-box/m-p/190579#M40929</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;could you please help me with scripting. I would like to create new columns automatically.&amp;nbsp;The part below "//Pad(+N_Pad) - column (start) ..." works, when the list_XRF={"DW", ..} was defined within the script and used.&lt;/P&gt;&lt;P&gt;But, how to create a "dialog window", that enables to enter a list with (if possible variable) items, that will be used for the following script&amp;nbsp;"//Pad(+N_Pad) - column (start) ..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table(); 

list_XRF = "";

//a=b=c=d=e=f=g=h=i=j=k=l=
//a,b,c,d,e,f,g,h,i,j,k,l,

m = n = o = p = "";
New Window( "Define Pad types",
	Modal,
	&amp;lt;&amp;lt;Return Result,
	Outline Box( "Please define", Table Box( list_XRF = String Col Edit Box( "Pad types", {m, n, o, p} ) ) )
);

//Pad(+N_Pad) - column (start)
//list_XRF ={"DW", "DW", "SI", "SI"}; // pad type for each set of XRF measurements

dt &amp;lt;&amp;lt; New Column( "Pad", "character", values( Repeat( list_XRF, Floor( N Rows( dt ) / N Items( list_XRF ) ) ) ) );

// Create Cumulative Frequencies
dt &amp;lt;&amp;lt; New Column( "N_pad", Numeric, Continuous );
dt:N_Pad &amp;lt;&amp;lt; Set Each Value( If( Row() == 1, 1, :Pad == Lag( :Pad, 1 ), Lag( :N_Pad, 1 ) + 1, 1 ) ); // end set each value
//Pad(+N_Pad) - column (end)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 12:45:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-a-list-as-variable-for-a-script-from-a-dialog-box/m-p/190579#M40929</guid>
      <dc:creator>PS_Ato</dc:creator>
      <dc:date>2019-04-01T12:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: get a list as variable for a script from a dialog box</title>
      <link>https://community.jmp.com/t5/Discussions/get-a-list-as-variable-for-a-script-from-a-dialog-box/m-p/190589#M40931</link>
      <description>&lt;P&gt;You're almost there.&amp;nbsp; &lt;STRONG&gt;list_xrf&lt;/STRONG&gt; refers to a display object and is not a list.&amp;nbsp; You have to get the list when the OK button is pushed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;m = n = o = p = "";
New Window( "Define Pad types",
	&amp;lt;&amp;lt; Modal,
	&amp;lt;&amp;lt; Return Result,
	Outline Box( "Please define", Table Box(pad_sceb = String Col Edit Box( "Pad types", {m, n, o, p} ) ) ),
	button box("OK",
		list_XRF = pad_sceb &amp;lt;&amp;lt; get;
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Apr 2019 13:28:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/get-a-list-as-variable-for-a-script-from-a-dialog-box/m-p/190589#M40931</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2019-04-01T13:28:35Z</dc:date>
    </item>
  </channel>
</rss>

