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


There is no New Script() function. Instead, to open a new script window, you use the New Window() function and then send it a message to tell it that it’s a script window:
win = New Window( "title", <<Script, "Initial Contents" );
In the New Window() example above, win is a reference to the display box that is the entire window. To write to a script window, you first need to get a reference to the part of the display box that you can write to, which is called a Script Box():
Using the reference ed, you can add text, remove text, and get the text that is already there.
Use the Set Text message to set all the text in the script window. The following message clears all text in the Script Window and then adds aaa=3; followed by a return:
Use the Append message to add additional text to the end of the script window.
Use the Get Line Text message to get the text at the line of a specified line number. Use the Set Line Text message to replace a specified line of text with new text.
Use the Get Line Count message to get the total number of lines in the script. The Get Lines message returns a list of each line in the script as a string.
Use the Reformat message to automatically format a script for easier reading.
Use the Save Text File() function to save the script to a text file with a .jsl extension.
Use the Get Window Title message to get the name of the script. The following example places the script name in the lower left corner of the report.
title = Current Window() << Get Window Title;
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
nw = New Window( "Distribution Report",
Distribution(
Continuous Distribution( Column( :weight ) ),
Nominal Distribution( Column( :age ) )
Text Box( title )
To close the script window, send the window the Close Window message, just like you can do with any JMP window.