<?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: Pause Script Until After User Manually Works on Data Table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/585896#M79158</link>
    <description>&lt;P&gt;Vince,&lt;/P&gt;&lt;P&gt;If I understand the user's question, I am trying to do a very similar thing, i.e. allow the user to edit a table before proceeding with the script. Maybe I didn't do something right, but when I use the script above within my script the program just keeps running causing an error because the necessary table edits have not been accomplished.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, if I use modal, the script stops but doesn't allow a table edit.&lt;/P&gt;&lt;P&gt;If I don't use modal a table edit is allowed before pressing OK but the script keeps running without the necessary edit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the script to stop running and not proceed until the user indicates that the table edits have been made.&lt;/P&gt;&lt;P&gt;Can this be done?&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patrick Carroll&lt;/P&gt;</description>
    <pubDate>Sun, 01 Jan 2023 17:43:52 GMT</pubDate>
    <dc:creator>pcarroll1</dc:creator>
    <dc:date>2023-01-01T17:43:52Z</dc:date>
    <item>
      <title>Pause Script Until After User Manually Works on Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/43994#M25381</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to pause my script so that a user can manually work on an open data table (manually examine data and add/delete rows or columns) before proceeding. &amp;nbsp;I've tried using a dialog box to accomplish this, but I can't work on the data table until after the dialog box is accepted. &amp;nbsp;Does anyone have any suggestions on how I can accomplish this? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clear Log();&lt;/P&gt;&lt;P&gt;Names Default to Here ( 1 );&lt;/P&gt;&lt;P&gt;dt.bigclass = Open( "$SAMPLE_DATA/Big Class.JMP" );&lt;/P&gt;&lt;P&gt;&amp;nbsp;New Window( "WAIT!",&lt;BR /&gt;&amp;lt;&amp;lt;modal,&lt;BR /&gt;Beep(),&lt;BR /&gt;V List Box(&lt;BR /&gt;Text Box(&lt;BR /&gt;"Manually Add/Delete Rows or Columns In Data Table"&lt;BR /&gt;),&lt;BR /&gt;)&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// User adds or subtracts rows/columns from open data table before proceeding&lt;/P&gt;&lt;P&gt;// Other instructions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 21:54:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/43994#M25381</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2017-09-06T21:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Pause Script Until After User Manually Works on Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/43996#M25382</link>
      <description>&lt;P&gt;Just don't make the new window modal. &amp;nbsp;Then have all the actions inside of the OK button (or whatever button).&amp;nbsp;&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.bigclass = Open( "$SAMPLE_DATA/Big Class.JMP" );
New Window( "WAIT!",	
	Beep(),
	V List Box( Text Box( "Manually Add/Delete Rows or Columns In Data Table" ), ), 
	Hlistbox(
		Buttonbox("OK", 
			&amp;lt;&amp;lt;Set Function(
				Function({self}, 
					print("do stuff");
					self&amp;lt;&amp;lt;Close Window;
				)
			)
			
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Sep 2017 22:40:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/43996#M25382</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2017-09-06T22:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pause Script Until After User Manually Works on Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/44131#M25421</link>
      <description>&lt;P&gt;Thanks Vince,&lt;/P&gt;&lt;P&gt;That was easy. &amp;nbsp;I guess I need to read about Modal properties.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 18:05:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/44131#M25421</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2017-09-08T18:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Pause Script Until After User Manually Works on Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/585896#M79158</link>
      <description>&lt;P&gt;Vince,&lt;/P&gt;&lt;P&gt;If I understand the user's question, I am trying to do a very similar thing, i.e. allow the user to edit a table before proceeding with the script. Maybe I didn't do something right, but when I use the script above within my script the program just keeps running causing an error because the necessary table edits have not been accomplished.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, if I use modal, the script stops but doesn't allow a table edit.&lt;/P&gt;&lt;P&gt;If I don't use modal a table edit is allowed before pressing OK but the script keeps running without the necessary edit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the script to stop running and not proceed until the user indicates that the table edits have been made.&lt;/P&gt;&lt;P&gt;Can this be done?&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patrick Carroll&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jan 2023 17:43:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/585896#M79158</guid>
      <dc:creator>pcarroll1</dc:creator>
      <dc:date>2023-01-01T17:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pause Script Until After User Manually Works on Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/585902#M79159</link>
      <description>&lt;P&gt;The script and idea provided by Vince should work, you have to place the actions which you want to perform, after button is pressed, &lt;STRONG&gt;inside the buttons function call&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Button Box("OK",
	&amp;lt;&amp;lt;Set Function(Function({self},
		Print("do stuff"); // this
		self &amp;lt;&amp;lt; Close Window; // and this
	))		
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The script which will be executed after the "OK" button is pressed is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;		Print("do stuff");
		self &amp;lt;&amp;lt; Close Window;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are other ways of doing this but this is most likely the easiest option and I would start with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jan 2023 07:10:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/585902#M79159</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-01-02T07:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Pause Script Until After User Manually Works on Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/586220#M79184</link>
      <description>&lt;P&gt;For this particular example, if you are wanting the user to perform manual operations on a table, you can create a data view/data box for that table that will show in the same window.&amp;nbsp; For example:&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 = New Table( "My Table" );
dt &amp;lt;&amp;lt; Add Rows( 10 );
dt &amp;lt;&amp;lt; New Column( "X1", Set Values( J( 10, 1, Random Normal() ) ) );
dt &amp;lt;&amp;lt; New Column( "X2", Set Values( J( 10, 1, Random Uniform() ) ) );

nw = New Window( "Prepare Your Data",
	hb = H List Box(
		V List Box(
			Text Box( "Delete Unneccesary Columns in Table and then click OK" ),
			Button Box( "OK", nw &amp;lt;&amp;lt; close window )
		), 
		
		Panel Box( "Data Table View",
			Border Box( Sides( 15 ), dt &amp;lt;&amp;lt; new data box(), &amp;lt;&amp;lt;border( 1 ) )
		)
	)
);
Wait( 0 );
nw &amp;lt;&amp;lt; bring window to front;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SamGardner_0-1672761509225.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/48782i80C39E15F713DBBD/image-size/large?v=v2&amp;amp;px=999" role="button" title="SamGardner_0-1672761509225.png" alt="SamGardner_0-1672761509225.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 15:59:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/586220#M79184</guid>
      <dc:creator>SamGardner</dc:creator>
      <dc:date>2023-01-03T15:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pause Script Until After User Manually Works on Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/586666#M79217</link>
      <description>&lt;P&gt;I'm guessing you are doing something like this.&amp;nbsp;&amp;nbsp;&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.bigclass = Open( "$SAMPLE_DATA/Big Class.JMP" );
New Window( "WAIT!",	
	Beep(),
	V List Box( Text Box( "Manually Add/Delete Rows or Columns In Data Table" ), ), 
	Hlistbox(
		Buttonbox("OK", 
			&amp;lt;&amp;lt;Set Function(
				Function({self}, 
					print("do stuff");
					self&amp;lt;&amp;lt;Close Window;
				)
			)
			
		)
	)
);

print("this shouldn't show until okay");
// other stuff&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where you don't want the "this shouldn't show until okay&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to not do ANYTHING else until okay is pressed though.&amp;nbsp; The normal way I do this is by using functions and calling them from the okay button.&amp;nbsp;&amp;nbsp;&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.bigclass = Open( "$SAMPLE_DATA/Big Class.JMP" );

action_okay = function({}, 
	//{DEFAULT LOCAL}, //uncomment this if you want the variables to be local only (don't exist outside the function)
	// put everything you want to do after okay button in here.  
	print("this shouldn't show until okay");
	// other stuff
);
New Window( "WAIT!",	
	Beep(),
	V List Box( Text Box( "Manually Add/Delete Rows or Columns In Data Table" ), ), 
	Hlistbox(
		Buttonbox("OK", 
			&amp;lt;&amp;lt;Set Function(
				Function({self}, 
					print("do stuff");
					action_okay();
					self&amp;lt;&amp;lt;Close Window;
				)
			)
			
		)
	)
);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jan 2023 17:10:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Pause-Script-Until-After-User-Manually-Works-on-Data-Table/m-p/586666#M79217</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2023-01-04T17:10:00Z</dc:date>
    </item>
  </channel>
</rss>

