cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
pcarroll1
Level IV

Can I pause a script to allow a user to edit a data table

I currently have a script which if run as highlighted lines works perfectly.  

Highlighting the first lines, a data table is created (from an SQL Query) and the script stops.

That table can then be edited (some rows are highlighted or deleted) and then the 2nd half of the script can be run.

 

I'd like for a user to run this without having to highlight script lines, so I need a way to pause the script until the user indicates the table is edited.

I tried New Window << Modal, but that does not allow any activity outside the GUI.

I tried New Window without Modal but the script keeps running without the edit.

How do I script in the pause as is done by running the script as two separate parts?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Can I pause a script to allow a user to edit a data table

You are correct about using Modal, you will not be able to manipulate the data table with it open.  However, you can simply use a standard window, and embed the code you want to process once the table is edited, and then submit that code when the "Continue" button is pressed.  Here is a simple example.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

Nw = New Window( "Make Edits",
	Text Box( "Please make any edits to the data table" ),
	Text Box( "that need to be made, and then press the \!"Continue\!" button" ),
	Spacer Box( size( 1, 15 ) ),
	Button Box( "Continue",
		nw << close window;
		Oneway( Y( :height ), X( :sex ) );
	)
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Can I pause a script to allow a user to edit a data table

You are correct about using Modal, you will not be able to manipulate the data table with it open.  However, you can simply use a standard window, and embed the code you want to process once the table is edited, and then submit that code when the "Continue" button is pressed.  Here is a simple example.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

Nw = New Window( "Make Edits",
	Text Box( "Please make any edits to the data table" ),
	Text Box( "that need to be made, and then press the \!"Continue\!" button" ),
	Spacer Box( size( 1, 15 ) ),
	Button Box( "Continue",
		nw << close window;
		Oneway( Y( :height ), X( :sex ) );
	)
);
Jim
pcarroll1
Level IV

Re: Can I pause a script to allow a user to edit a data table

txnelson,

    Thank You!  I saw a similar response to this question in a post from a few years ago, but I didn't understand (my fault) that the secret is to put the second part of the code in the Button Box.  I understand your explanation clearly. 

 

BTW: Do you know if there is any reason why JMP just can't add a Pause Script Box?  It seems it would be much simpler.  I could add it to the Wishlist.

pcarroll1