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


There is no New Script command. 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:
In the New Window example above, ww 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 Set Text to set all the text in the script window. The following command clears all text in the Script Window and then adds aaa=3; followed by a return:
Use Append to add additional text to the end of the script window.
Use the Get Line Text command to get the text at the line of a specified line number. Use the Set Line Text command 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.
To close the script window without saving the script, send the window the Close Window message, just like you can do with any JMP window.
To save and view the script, use the Save Text and Load Text File messages:
ww = New Window( "Test", <<Script, "Open(\!"$SAMPLE_DATA\Big Class.jmp\!");");
ww << Save Text( "$TEMP/Test.jsl" );
Write( Load Text File( "$TEMP/Test.jsl" ) );
注意:When the script is loaded into the script window, the window is considered “dirty” or modified. Use <<Set Dirty(0) to remove this property. Otherwise, you are prompted to save the script when you close the window.
ww = New Window( "Test", <<Script, "Open(\!"$SAMPLE_DATA\Big Class.jmp\!");");
ww << Save Text( "$TEMP/Test.jsl" );
ww << Close Window();