When you submit a script with a modal window, JMP draws the window, waits for the user to make choices and click OK, and then stores a list of the variables with their values. Any attempt to click outside the window produces an error sound, and script execution is suspended until the user clicks OK or Cancel.
The Column Dialog() function is specifically intended to prompt users to choose columns from the current (topmost) data table. Windows created by Column Dialog() are also modal windows.
<<Modal,
Notice that the argument to Number Edit Box() is the default value, 42.
图 11.34 Sample Modal Display Box
If you click OK, the window closes and {Button(1)} is returned. To get the value entered in the box, use the Return Result message and a subscript into the window. Note that the deprecated Dialog() returns the list of variable assignments the same way.
<<Modal,
<<Return Result,
Write( win["variablebox"] );
Note that a modal window must have at least one button. If you omit the Button Box() from your script, an OK button is automatically included. To omit the OK button, set the visibility to collapse.
<<Modal,
注意:Modal windows require at least one button for dismissing the window. You can use OK, Yes, No, or Cancel to label modal window buttons. If you do not include at least one of these buttons in a modal window, JMP adds an OK button.