<?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 Script skipping order of evaluation in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-skipping-order-of-evaluation/m-p/436045#M68527</link>
    <description>&lt;P&gt;Hi. I'm hoping that this is just a fluke on my part.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a script that first creates a "duration" column &amp;amp; evaluates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, i have the script find blanks and fill with previous non blank value (for deadbanding). it does this by generating a pop-up window for one to select which columns need this applied (granted, if i could just assume all of them need it, that *could* be one option of circumventing this issue)&lt;/P&gt;&lt;P&gt;However, the script doesn't "wait" for me to select which columns i want to fill down before moving to next lines.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do i get around this??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Names Default to Here(1);
dt=Current Data Table();
column(dt, "Time")&amp;lt;&amp;lt;Data Type("Numeric", Informat("m/d/y h:m:s"), Format("h:m:s"));
dt1=Current Data Table();
dt1&amp;lt;&amp;lt;New Column("Duration", Units("seconds"), Formula(:Time-Col Minimum(:Time)));
Column("Duration")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt; Modeling Type(Continuous)&amp;lt;&amp;lt; Format("fixed dec", 20, 0);


_dt = Current Data Table();

colnames = _dt &amp;lt;&amp;lt; Get Column Names( String );

fillcolumns = Expr(
	selectedcols = _lb &amp;lt;&amp;lt; Get Selected;
	nc = N Items( selectedcols );

	nr = N Rows( _dt );

	For( ii = 2, ii &amp;lt;= nr, ii++,
		For( jj = 1, jj &amp;lt;= nc, jj++,
			If( is missing(Column( _dt, selectedcols[jj] )[ii]),
				Column( _dt, selectedcols[jj] )[ii] = Column( _dt, selectedcols[jj] )[ii - 1]
			);
		)
	);
	_nw &amp;lt;&amp;lt; Close Window;
);

_nw = New Window( "Fill Down Blanks",
 _tb = Text Box("This script will fill missing values in the columns you select, by using the value in the last previous not empty row for that column"),
	_hb = H List Box(
		_pb = Panel Box( "Select Columns", _lb = List Box( colnames, width( 300 ) ) ),
		_bb = Button Box( "Go", fillcolumns )
	)
);

Names Default To Here(1);

dt3=Current Data Table();
dt3&amp;lt;&amp;lt;Select where(((:x==0) | (Is Missing(:x)))); 
dt3&amp;lt;&amp;lt;delete rows;

dt4=Current Data Table();
dt4&amp;lt;&amp;lt;New Column("a", formula(4));
Column(dt4, "a")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Ordinal);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:40:26 GMT</pubDate>
    <dc:creator>haleyhoewt</dc:creator>
    <dc:date>2023-06-10T23:40:26Z</dc:date>
    <item>
      <title>Script skipping order of evaluation</title>
      <link>https://community.jmp.com/t5/Discussions/Script-skipping-order-of-evaluation/m-p/436045#M68527</link>
      <description>&lt;P&gt;Hi. I'm hoping that this is just a fluke on my part.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a script that first creates a "duration" column &amp;amp; evaluates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, i have the script find blanks and fill with previous non blank value (for deadbanding). it does this by generating a pop-up window for one to select which columns need this applied (granted, if i could just assume all of them need it, that *could* be one option of circumventing this issue)&lt;/P&gt;&lt;P&gt;However, the script doesn't "wait" for me to select which columns i want to fill down before moving to next lines.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do i get around this??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Names Default to Here(1);
dt=Current Data Table();
column(dt, "Time")&amp;lt;&amp;lt;Data Type("Numeric", Informat("m/d/y h:m:s"), Format("h:m:s"));
dt1=Current Data Table();
dt1&amp;lt;&amp;lt;New Column("Duration", Units("seconds"), Formula(:Time-Col Minimum(:Time)));
Column("Duration")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt; Modeling Type(Continuous)&amp;lt;&amp;lt; Format("fixed dec", 20, 0);


_dt = Current Data Table();

colnames = _dt &amp;lt;&amp;lt; Get Column Names( String );

fillcolumns = Expr(
	selectedcols = _lb &amp;lt;&amp;lt; Get Selected;
	nc = N Items( selectedcols );

	nr = N Rows( _dt );

	For( ii = 2, ii &amp;lt;= nr, ii++,
		For( jj = 1, jj &amp;lt;= nc, jj++,
			If( is missing(Column( _dt, selectedcols[jj] )[ii]),
				Column( _dt, selectedcols[jj] )[ii] = Column( _dt, selectedcols[jj] )[ii - 1]
			);
		)
	);
	_nw &amp;lt;&amp;lt; Close Window;
);

_nw = New Window( "Fill Down Blanks",
 _tb = Text Box("This script will fill missing values in the columns you select, by using the value in the last previous not empty row for that column"),
	_hb = H List Box(
		_pb = Panel Box( "Select Columns", _lb = List Box( colnames, width( 300 ) ) ),
		_bb = Button Box( "Go", fillcolumns )
	)
);

Names Default To Here(1);

dt3=Current Data Table();
dt3&amp;lt;&amp;lt;Select where(((:x==0) | (Is Missing(:x)))); 
dt3&amp;lt;&amp;lt;delete rows;

dt4=Current Data Table();
dt4&amp;lt;&amp;lt;New Column("a", formula(4));
Column(dt4, "a")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Ordinal);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:40:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-skipping-order-of-evaluation/m-p/436045#M68527</guid>
      <dc:creator>haleyhoewt</dc:creator>
      <dc:date>2023-06-10T23:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script skipping order of evaluation</title>
      <link>https://community.jmp.com/t5/Discussions/Script-skipping-order-of-evaluation/m-p/436053#M68529</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You may be able to solve your issue by adding a "Wait (0)" command just before your _nw = New Window statement.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 22:55:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-skipping-order-of-evaluation/m-p/436053#M68529</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2021-11-12T22:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script skipping order of evaluation</title>
      <link>https://community.jmp.com/t5/Discussions/Script-skipping-order-of-evaluation/m-p/436064#M68531</link>
      <description>&lt;P&gt;You need a &lt;EM&gt;&lt;STRONG&gt;modal&lt;/STRONG&gt;&lt;/EM&gt; window.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/16.1/?os=win&amp;amp;source=application&amp;amp;utm_source=helpmenu&amp;amp;utm_medium=application#page/jmp/construct-a-modal-window.shtml" target="_self"&gt;https://www.jmp.com/support/help/en/16.1/?os=win&amp;amp;source=application&amp;amp;utm_source=helpmenu&amp;amp;utm_medium=application#page/jmp/construct-a-modal-window.shtml&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;Construct a&amp;nbsp;&lt;SPAN class="Search_Result_Highlight" style="background-color: yellow; color: #333333;"&gt;Modal&lt;/SPAN&gt;&amp;nbsp;Window&lt;/EM&gt;&lt;/P&gt;
&lt;P class="body" style="font-family: arial, sans_serif; font-size: 16px; color: #222222; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0.25px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;EM&gt;When you submit a script with a&amp;nbsp;&lt;SPAN class="Search_Result_Highlight" style="background-color: yellow; color: #333333;"&gt;modal&lt;/SPAN&gt;&amp;nbsp;window, JMP draws the window, waits for the user to make choices and click&amp;nbsp;&lt;SPAN class="command" style="font-weight: bold; line-height: 1;"&gt;OK&lt;/SPAN&gt;, and then stores a list of the variables with their values. Any attempt to click outside the window produces an error sound, and script execution is suspended until the user clicks&amp;nbsp;&lt;SPAN class="command" style="font-weight: bold; line-height: 1;"&gt;OK&lt;/SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;SPAN class="command" style="font-weight: bold; line-height: 1;"&gt;Cancel&lt;/SPAN&gt;.&lt;/EM&gt;"&lt;/P&gt;
&lt;P class="body" style="font-family: arial, sans_serif; font-size: 16px; color: #222222; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0.25px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="body" style="font-family: arial, sans_serif; font-size: 16px; color: #222222; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0.25px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;You'll find lots of questions and answers about modal windows in the community. At one time, on some OSs, you could refer to variables in a modal window for a short time after the window was closed. That's no longer true. There are several patterns people use for getting variables back...pick one that makes sense to you. The link above uses "return result".&lt;/P&gt;
&lt;P class="body" style="font-family: arial, sans_serif; font-size: 16px; color: #222222; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0.25px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="body" style="font-family: arial, sans_serif; font-size: 16px; color: #222222; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: 0.25px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;edit: new post at &lt;LI-MESSAGE title="Modal Dialogs" uid="436177" url="https://community.jmp.com/t5/Uncharted/Modal-Dialogs/m-p/436177#U436177" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; might help.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 01:41:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-skipping-order-of-evaluation/m-p/436064#M68531</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-11-15T01:41:06Z</dc:date>
    </item>
  </channel>
</rss>

