Cannot perform math on returned value from Number Edit BoxI'm trying to run a very simple script that requests a numerical input from the user. Unfortunately, I cannot perform numerical operations such as subtract and divide on the returned value. Am quite new to jsl, so I must be doing something wrong that must be very simple to correct. the error message is:
"Cannot convert argument to a number [or matrix] in access or evaluation of 'Divide', minfeat_abs/ /*###*/1000/*###*/"
Any help would be greatly appreciated. Have been banging away at this for hours.
Please see the script below:
win = New Window( "Feature Depth" ,
<<MODAL></MODAL>
Automation and ScriptingQuality and Process EngineeringRe: Cannot perform math on returned value from Number Edit BoxPlease see Help for this topic.
Re: Cannot perform math on returned value from Number Edit BoxThis script performed properly by itself, but when combined with a script to select rows in a table against a given criteria (number greater than neb_content/2 for example) it gave the error: Name Unresolved: Feature{1} in access or evaluation of 'Feature' , Feature/*###*/
where "Feature" was the name of the column in the data table.
I would like to understand why this is occurring.
However, the tip on using the scripting guide with each jmp version is a good one. Thanks!
Re: Cannot perform math on returned value from Number Edit BoxTry this:
win = New Window( "Feature Depth" ,
<<MODAL></MODAL>
I think it has something to do with the <
Re: Cannot perform math on returned value from Number Edit BoxDear all,
I think this does not work, because with closing the window, the variable and the scope has gone. JMP returns it in a different way. A global variable may work.
So when I struggle with these kind of things, I tend to look in the scripting index for the current way to do this kind of things (they may change somehow from version to version). And I find it as an example for "new window, modal", that I slightly modified, see screenshot and attached script. The reference of the window returns all you need.
Names Default To Here( 1 );
ex = New Window( "Dialog() example",
<<MODAL></MODAL>

Re: Cannot perform math on returned value from Number Edit BoxStill getting an error, even when I copy and past the script that Thierry suggested.
deleted object reference: NEB << get in access or evaluation of 'Glue'...

Re: Cannot perform math on returned value from Number Edit BoxHi,
I did struggle with the proper way to get values out of modal windows until @txnelson showed me how:
Names Default to Here (1);
win = New Window( "Feature Depth" ,
<<MODAL></MODAL>