cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
deliaaa
Level II

Need help to reference to a user input entry to the jsl

Hi, I'm trying to reference back to the user input as the name filter for the MFI in my script but when I run the script it seems to run the MFI portion first before opening up the user input window. Can someone help advise what went wrong? Appreciate!

 

Names Default To Here(1);

win = New Window( "Set the Value",
	H List Box( Text Box( "Set this value" ), num_edit_box1 = Text Edit Box( "lot" ) ),
	
	H List Box(
		Button Box( "OK", 
		
			//store results in jsl variables
			num_input = num_edit_box1 << get text();
		
			//close the window
			//wait until you've unloaded the input boxes before you closing
			//or else they'll be gone
			win << close window;
			
			//now do whatever work you want with the inputs
			Show( num_input );
			Print( num_input );
		),
		
		//a cancel button that closes the window and doesn't store store the results
		Button Box( "Cancel", win << close window )
	)
);

Multiple File Import(
	<<Set Folder( "C:XXXX" ),
	<<Set Name Filter( "num_input.csv" ),
	<<Set Name Enable( 1 ),
	<<Set Size Filter( {14753758, 16813862} ),
	<<Set Size Enable( 0 ),

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Need help to reference to a user input entry to the jsl

JMP does not stop processing when a New Window() is specified, unless it is a Modal window, or the New Window is the last code in the script.
Therefore, you have a couple of options, to correct your code.
Add <<Modal, as one of the definition elements of your New Window()
Move the MFI code into the OK Button execution
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Need help to reference to a user input entry to the jsl

JMP does not stop processing when a New Window() is specified, unless it is a Modal window, or the New Window is the last code in the script.
Therefore, you have a couple of options, to correct your code.
Add <<Modal, as one of the definition elements of your New Window()
Move the MFI code into the OK Button execution
Jim
deliaaa
Level II

Re: Need help to reference to a user input entry to the jsl

Hi @txnelson , thanks so much for the input! Adding <<Modal works well!

However, I now have problem referencing to the user input variable for "num_input" as the Name filter for the MFI, tried a few ways to do it but doesn't work. I'm very new to jsl, hope to get some advice.

 

Multiple File Import(
<<Set Folder( "C:XXXX" ),
<<Set Name Filter( "num_input.csv" ),
<<Set Name Enable( 1 ),
<<Set Size Filter( {14753758, 16813862} ),
<<Set Size Enable( 0 ),
txnelson
Super User

Re: Need help to reference to a user input entry to the jsl

I assume there is no such file as "num_input.csv".  What I believe you want is

<< Set Name Filter( num_input || ".csv" ),

You need to take the time to read the Scripting Guide.  It will give you the background of the structures of JSL.  It is available in the JMP Documentation Library under the Help pull down menu

 

Jim