Get values from Modal New Window<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I am having trouble getting values after I use a modal New Window Box.
If I run the example from the JMP 9 Scripting Guide:
New Window("Set a Value",<
TextBox("Set this Value"),
variablebox = Number Edit Box(42),
Button Box("OK"),
Button Box("Cancel")
);
variablebox<
I get this error: "Send Expects Scriptable Object in access or evaluation of 'Send', variablebox<
On the other hand:
When I run just the code
variablebox = Number Edit Box(42);
variablebox<
I get:
42
Anyone know what I've done wrong here? I can't seem to make "get" retrieve variables from any of the modal windows I've tried.
Thank you!
Get values from Modal New WindowJust to be slightly pedantic about this - the reference is only lost once the script completes execution. So the example you gave does work correctly, but only if you allow the entire script to execute (as opposed to running a partial block of code). Therefore if you were to create a modal window without explicit button display boxes, it would still work e.g.
New Window("Set a Value",<
TextBox("Set this Value"),
variablebox = Number Edit Box(42),
);
x = variablebox<
show(x);
-Dave
Get values from Modal New WindowThank you for the help!
Re: Get values from Modal New WindowAs soon Ok or Cancel is clicked, the reference is forgotten, and hence the error. Put the get command, or any script, inside the Ok-button to ensure that it will run before the modal window is history.
New Window( "Set a Value",
<<Modal,
Text Box( "Set this Value" ),
variablebox = Number Edit Box( 42 ),
Button Box( "OK", value = variablebox << get ),
Button Box( "Cancel" )
);
Show( value );
Get values from Modal New WindowI just noticed something interesting:
If I run the New Window as a block of code by itself and then run the variablebox<