该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


To have a New Window() script automatically return the results after the user clicks OK, include the Return Result message after the Modal message.
win = New Window( "Set a Value",
<<Modal,
<<Return Result,
Text Box( "Set this value" ),
variablebox = Number Edit Box( 42 ),
Button Box( "OK" ),
Button Box( "Cancel" )
Write( win["variablebox"] ); // create a subscript to the variablebox variable
33 // the user typed "33" in the number edit box
Include the Get message to return 1 for a selected check box and 0 for a deselected check box. To view the selection, add a Show() expression at the end of the script.
win = New Window( "V List Box",
<<Modal,
V List Box(
kb1 = Check Box( "a" ),
kb2 = Check Box( "b" ),
kb3 = Check Box( "c" )
Button Box( "OK",
val1 = kb1 << Get; // get the value of the first check box
Show( val1, val2, val3 ); // return variables after window closes
val1 = 1; // first and second checkboxes are selected
val3 = 0; // third checkbox is not selected
Include the Get Selected message to return the selected column names and then insert the columns in a Bivariate plot.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
win = New Window( "Return Values",
<<Modal,
<<On Validate(
Show( xvar, yvar );
If( Is Missing( xvar ) | Is Missing( yvar ),
0, // if xvar or yvar are missing, do nothing when OK is clicked
1
Text Box( " Select two numeric columns. " ),
H List Box(
Text Box( " X, Factor " ),
x = Col List Box(
dt, // data table reference
all, // display all columns from the data table
xvar = (x << Get Selected)[1];
Show( xvar );
Text Box( "Y, Response" ),
y = Col List Box(
yvar = (y << Get Selected)[1];
Show( yvar );
xcol = Column( dt, xvar ); // get the columns
ycol = Column( dt, yvar );
dt << Bivariate( Y( ycol ), X( xcol ) ); // create a Bivariate plot