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


New Window() and Column Dialog() enable you to construct a launch window that has a column selector. Use Column Dialog() to construct a simple launch window. Several items are added automatically to column dialogs: the Remove and Cancel buttons, the list of columns, and an OK button (if no buttons are explicitly defined).
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dlg = Column Dialog(
x = ColList( "X", Max Col( 1 ) ),
y = ColList( "Y", Max Col( 1 ) )
Show( dlg );
If( dlg["Button"] == 1,
Show( xCol, yCol );
New Window() is more flexible because of numerous optional arguments. In the following example, the user must select two columns before clicking the OK button. A Bivariate graph is then created. Validating the user’s selections is not possible in Column Dialog().
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
win = New Window( "Example of Returning Values",
<<Modal,
<<On Validate(
// require the user to select two variables before clicking OK
Show( xvar, yvar );
If( Is Missing( xvar ) | Is Missing( yvar ),
// if xvar or yvar are missing do nothing when OK is clicked
0,
1
Text Box( " Select two numeric columns. " ),
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];
// get the name of the selected column before the window closes
Show( xvar );
Text Box( "Y, Response" ),
y = Col List Box(
yvar = (y << Get Selected)[1];
Show( yvar );
If (win["Button"] == 1, // if the user clicks OK...
xcol = Column( dt, xvar ); // get the columns
ycol = Column( dt, yvar );
dt << Bivariate( Y( ycol ), X( xcol ) ); // create a Bivariate plot