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
Neo
Neo
Level VI

Script works as expected in JMP13 but throws an error in JMP16 ?

The following script works fine in JMP 13.2.1 and produces expected output but throws an error when run in JMP16.1.0. What part in the script is not acceptable in JMP16?

 

Names Default to Here (1);
//clear symbols ();
//clear log ();
dlg = New Window("Please enter the following", << Modal, <<Return Result,
	Border Box(Top(20), Bottom(0), Left(20), Right(20),
		V List Box(	tb1= Text Box("partID: "),
					teb1 = Text Edit Box("part101.011.01", <<Set Width(150)),
					teb1<< Set Hint( "e.g. part101.011.01" );

					tb6=Text Box("User Comment: "),
					teb6 = Text Edit Box("", <<Set Width(150)),
					teb6<< Set Hint( "e.g. Fails are a test artefact" );
					teb6<< Fixed Size( 0 );
		
					tb1<< set font style("bold");
					tb6<< set font style("bold");
		);         
	);
);
					partID = teb1 << Get Text;
					custom text = teb6 << Get Text;

If (dlg["Button"]==-1, Throw());

//Show(partID);
//Show (custom text);

JMP 16.1.0 gives the following error.

JMP16error.PNG

Not sure where 'Glue' is coming from?

When it's too good to be true, it's neither
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Script works as expected in JMP13 but throws an error in JMP16 ?

That was an informative read, @Craige_Hales. Makes me realize I've probably been doing it a little wrong and I might instead have suggested the following to @Neo:

Names Default to Here (1);

dlg = New Window("Please enter the following", << Modal, <<Return Result,
	Border Box(Top(20), Bottom(0), Left(20), Right(20),
		V List Box(	tb1= Text Box("partID: "),
					teb1 = Text Edit Box("part101.011.01", <<Set Width(150)),
					teb1<< Set Hint( "e.g. part101.011.01" );

					tb6=Text Box("User Comment: "),
					teb6 = Text Edit Box("", <<Set Width(150)),
					teb6<< Set Hint( "e.g. Fails are a test artefact" );
					teb6<< Fixed Size( 0 );
		
					tb1<< set font style("bold");
					tb6<< set font style("bold");
		);         
	);
);

partID = dlg["teb1"];
custom text = dlg["teb6"];
Ross Metusalem
JMP Academic Ambassador

View solution in original post

5 REPLIES 5
jthi
Super User

Re: Script works as expected in JMP13 but throws an error in JMP16 ?

I think the cause of the issue is how newer version of JMP handles the values which are returned from modal windows.After the modal window is closed, you don't have access to teb1 and teb6 anymore. This help topic should help you get the script converted to newer jmp version: Convert Deprecated Dialog to New Window (get the when OK is pressed or from dlg with dlg["teb1"] and so on).

-Jarmo

Re: Script works as expected in JMP13 but throws an error in JMP16 ?

@jthi is right. Here's a version of your script with a Button Box inside the V List Box that gets the user-entered text when the window closes. As for "Glue", that refers to the semicolon, which is the glue operator (see Glue() function).

Names Default to Here (1);
//clear symbols ();
//clear log ();
dlg = New Window("Please enter the following", << Modal, <<Return Result,
	Border Box(Top(20), Bottom(0), Left(20), Right(20),
		V List Box(	tb1= Text Box("partID: "),
					teb1 = Text Edit Box("part101.011.01", <<Set Width(150)),
					teb1<< Set Hint( "e.g. part101.011.01" );

					tb6=Text Box("User Comment: "),
					teb6 = Text Edit Box("", <<Set Width(150)),
					teb6<< Set Hint( "e.g. Fails are a test artefact" );
					teb6<< Fixed Size( 0 );
		
					tb1<< set font style("bold");
					tb6<< set font style("bold");
	
					Button Box( "OK", 
						partID = teb1 << Get Text;
						custom text = teb6 << Get Text;
					)
		);         
	);
);

If (dlg["Button"]==-1, Throw());

//Show(partID);
//Show (custom text);

 

Ross Metusalem
JMP Academic Ambassador
Craige_Hales
Super User

Re: Script works as expected in JMP13 but throws an error in JMP16 ?

Modal Dialogs  has a bit of the back story on why it changed.

Craige

Re: Script works as expected in JMP13 but throws an error in JMP16 ?

That was an informative read, @Craige_Hales. Makes me realize I've probably been doing it a little wrong and I might instead have suggested the following to @Neo:

Names Default to Here (1);

dlg = New Window("Please enter the following", << Modal, <<Return Result,
	Border Box(Top(20), Bottom(0), Left(20), Right(20),
		V List Box(	tb1= Text Box("partID: "),
					teb1 = Text Edit Box("part101.011.01", <<Set Width(150)),
					teb1<< Set Hint( "e.g. part101.011.01" );

					tb6=Text Box("User Comment: "),
					teb6 = Text Edit Box("", <<Set Width(150)),
					teb6<< Set Hint( "e.g. Fails are a test artefact" );
					teb6<< Fixed Size( 0 );
		
					tb1<< set font style("bold");
					tb6<< set font style("bold");
		);         
	);
);

partID = dlg["teb1"];
custom text = dlg["teb6"];
Ross Metusalem
JMP Academic Ambassador
jthi
Super User

Re: Script works as expected in JMP13 but throws an error in JMP16 ?

When using << Return Result there might sometimes be unexpected (at least they were for me) results, if you are using more complicated display boxes than text and number edit boxes, that are good to keep in mind. But in this case if there are only Text Edit Boxes I think getting the results after Modal has closed is simplest and cleanest solution.

-Jarmo