The following example shows a simple button box. When the user clicks the button box, "Pressed" is printed to the log.
cal << Date( date );
Returns 1 if the check box item specified by n is selected, or 0 otherwise.
Sets the check box item specified by n as either selected (1) or cleared (0).
Sets the check box item specified by n as either enabled (1) or disabled (0). The state of a disabled check box cannot be changed.
exx = 1;
exy = 4;
exz = 8;
an optional command that adds all columns of the current data table into the list. Omitting "all" results in an empty collistbox with the “optional” label. To display “optional character”, specify "character". To display “optional numeric”, specify "numeric".
an optional command that sets the width of the list box to pixels. Pixels is a number that measures pixels.
An optional number that only allows n columns to be added to the list.
An optional number that only requires at least n columns for the list. If n=2, the top two slots in the Col List Box an initial display of “required numeric” (or whatever you set the data type to be).
Overrides any tool tips set using Set Tips() function. If there is a tip set for the box, you cannot set tips for each individual item.
Using Set Tip() with no arguments clears the list box tip and allows the individual item tool tips to be displayed.
‒
|
The maxSelected argument only affects whether one or more than one item can be selected. It does not enforce a limit greater than 1.
|
<<Modal,
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
{xx, yy} = tri << Get Points();
g = Graph Box(
Dialog is deprecated. Use New Window() with the Modal argument instead. See “Convert Deprecated Dialog to New Window” in the Scripting Guide for details.
Returns a display box containing the excerpt designated by the report held at number report and the list of display subscripts subscripts. The subscripts reflect the current state of the report, after previous excerpts have been removed.
Converts expr() to a picture as it would appear in the Formula Editor.
Returns a reference to a specific open window by title, index, or display box. By default, Get Window() returns windows from the current project (or no project when you’re not running the script from a project).
To limit the search to particular types of windows, use the Type () argument and one of these strings: "Data Tables", "Journals", "Reports", or "Dialogs".
Returns a list of currently open windows. By default, Get Window List() returns a list of currently open windows in the current project. You can return an open window list from something other than the current project by using the Project() argument. To limit the search to particular types of windows, use the Type () argument and one of these strings: "Data Tables", "Journals", "Reports", or "Dialogs".
To limit the search to particular types of windows, use the Type () argument and one of these strings: "Data Tables", "Journals", "Reports", or "Dialogs".
Constructs a box for editing global value directly.
Named property arguments: title("title"), XScale(low, high), YScale(low, high), FrameSize(h, v), XName("x"), YName("y"), SuppressAxes.
Returns a display box that arranges the display boxes provided by the arguments in a horizontal layout. The <<Hold() message tells the sheet to own the report(s) that is excerpted.
<<Size(n)
Specifies the proportions of the last panel. <<Size(.25) resizes the last panel to 25% the splitter box height (or width, for vertical splitter boxes).
Specifies the proportions of each panel. db<<Set Sizes({.75, .25}) sizes the first panel to 75% and the second panel to 25% of the splitter box height (or width, for vertical splitter boxes).
Closes the panel that you specify. <<Close Panel(2) closes the second panel. With three or more panels, you must include the second Boolean value. That value indicates which panel expands to fill the space left by the closed panel.
‒
|
<<Close Panel(2,0) closes the second panel; the following sibling takes the extra space.
|
‒
|
<<Close Panel(2,1) closes the second panel; the preceding sibling takes the extra space.
|
Opens the panel that you specify. With three or more panels, you must include the second Boolean value. Works similar to <<Close Panel described above. The panels are initially opened. You use <<Open Panel only after using <<Close Panel.
Constructs a node of a tree (similar to Diagram output) containing text. Hier Box can contain additional Hier Boxes, allowing you to create a tree. The text can be a Text Edit Box.
Appendix B, “JMP Icon Names” specifies the icon names.
1 displays the display boxes inside the If Box; if 0, does not display them.
Constructs a display box that displays the quoted string journal box. We recommend that you do not generate the journal text by hand.
Displays the matrix given in the usual array form.
Specifies the object that the user interacts with, such as a Text Box or Button Box. See the Scripting Index in the Help menu for details.
A list of windows to move to the project. If omitted, all windows will be moved. Note that the data table and all of its dependent reports will be moved. However, you need to specify only the data table name or report name in the windows argument to move it.
project = New Project();
Move to Project( destination( project ), windows( {report} ) );
Creates bookmarks for frequently used files in the project. Existing bookmarks are retained. The argument is a list of bookmark items, each of which is specified using File(), Folder(), or Group(). Group() accepts File(), Folder(), and Group() as children. See “Create a Bookmark Group” in the Scripting Guide for an example of how to construct the arguments.
Returns the list of bookmarks in the project. The format of the returned list is the same as is used by Add Bookmarks and Set Bookmarks.
Saves the project. Include a path and file name to save the project to a specific location. If the project has already been saved, this argument is optional. Save As is an alias.
Sets the bookmarks for the project. Unlike Add Bookmarks, existing bookmarks are removed. The argument is a list of bookmark items, each of which is specified using File(), Folder(), or Group(). Group() accepts File(), Folder(), and Group() as children.
The following example creates a project from BigClass.jmp and two reports.
project = New Project();
project << Run Script(
“Creating Projects” in the Scripting Guide.
Creates a new script window. The optional quoted string script is placed inside the script window.
Makes the new window a modal window, which prevents any other actions in JMP until the window is closed. If you do not include an OK or Cancel button, one is added automatically for you. Note: If used, this argument must be the second argument, directly after the window title. Available modal window arguments are:
‒
|
<<On Open(expr) runs expr when the window is created.
|
注意:In data tables, On Open (or OnOpen) scripts that execute other programs are never run. Set the Evaluate OnOpen Scripts preference to control when the script is run.
‒
|
<<On Close (expr) runs expr when the window is closed. Returns 0 if the window fails to close.
|
‒
|
<<On Validate (expr) runs expr when the OK button is pressed. If it returns True, the window is closed otherwise the window remains open.
|
‒
|
<<Return Result changes the window’s return value when it closes to match that of the deprecated Dialog() function.
|
Dialog() was deprecated in JMP 10. Use New Window() with the Modal argument instead. See “Convert Deprecated Dialog to New Window” in the Scripting Guide for details about using New Window().
Creates a column named title with numeric entries given in list or matrix form.
Creates a column named title with numeric entries given in list or matrix form. The numbers can be edited.
Creates an editable number box that initially contains the initValue argument.
Creates a new outline named title containing the listed display boxes.
Creates a display box labeled with the quoted string title that contains the listed display boxes.
New Window( "Example",
Returns a display box labeled with the quoted string title to graph the numbers. The numbers can be either a list or a matrix.
frame = g[FrameBox( 1 )];
Creates a red triangle menu. The single argument is an expression yielding a list of an even number of items alternating between the command string and the expression that you want evaluated when the command is selected. If the command is an empty string, a separator line is inserted. Note: Pressing ALT and right-clicking the red triangle menu opens a window with check boxes for the commands. See “访问报表显示选项” in the Using JMP book for details.
Range Slider Box() returns a display box that shows a range slider control that ranges from minValue to maxValue. As the two sliders' positions change, their values are placed into lowVariable and highVariable, and the script is run.
Returns the display tree of a platform obj. This can also be sent as a message to a platform:
ex = Scene Display List();
exScene << Show Arcball( always );
New Window( "See HelloWorld.jsl in sample scripts", exScene );
exScene << Update;
Constructs an editable box that contains the quoted string script. The editable box is a script window and can both be edited and run as JSL.
sb = Scroll Box(
width( 200 ),
max selected( 2 ),
nlines( 6 )
Returns a display box containing the display box argument with the quoted string title as its title.
ex = .6;
Creates column in the table containing the string items listed.
Creates column in the table containing the string items listed. The string boxes are editable.
(Previously called Tab List Box.) Creates a tabbed window pane. The arguments are an even number of items alternating between the name of a tab page and the contents of the tab page.
Certain messages you can send to Tab Page Box have been renamed, as follows:
‒
|
Set Title to Title
|
‒
|
Set Tip to Tip
|
‒
|
Set Icon to Icon
|
‒
|
Set Closeable to Closeable
|
New Window( "Example",
Creates a report table with the display boxes listed as columns.
project = New Project();
project << Run Script(
New Window( "Project Title",
Text Box(This Project() << Get Window Title())
Specifies the names for the root nodes created by Tree Node() which the box contains.
Creates a node for display in a Tree Box display. Tree Node is used for both parent and child nodes.
If you send a root node that contains one or more nodes with the Set Node Select Script defining a collapse message, then Mac runs the script twice. Windows doesn’t run the script. This behavior on Macintosh doesn’t just affect increments. Any script runs twice. It will print to the log twice, create a column twice, try to delete something twice, and so on.
tri = Triangulation(
Y( [0 1 2 3] )
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
Returns a display box that arranges the display boxes provided by the arguments in a vertical layout. The <<Hold() message tells the sheet to own the report(s) that is excerpted.
For details about the optional arguments, see H Splitter Box(<size(h,v)>, display box, <arguments>).
New Window( "Example",
The <a href> target “_blank” opens the web page in a new Internet Explorer window. The <a href> target “_new” opens the web page in the active Internet Explorer tab.