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


注意:The current row in a JSL script is not determined by selecting rows or positioning your cursor in the row. The current row is defined to be zero (no row) by default. You can set a current row with Row() (for example, Row() = 3). Please note that such a setting only lasts for the duration of that script. Then, Row() reverts to its default value, zero. This behavior means that submitting a script all at once can produce different results than submitting a script a few lines at a time.
Another way to establish a current row for a script is to enclose it in For Each Row(). This method executes the script once for each row of the current data table. For an example, see If. See “Data Tables” chapter on page 303 for more information about working with data tables.
Yes. Once you use a scoping operator with a name, that name continues to be resolved accordingly for all subsequent occurrences of the name. For example, a script might contain a column and a variable named age. When you declare the global variable age with the scoping operator :: at the beginning of the script, age is always interpreted as a global variable in the script. The values in the age column are not affected by the variable.
Open( "$SAMPLE_DATA/Big Class.jmp" );
age = 5; // age is a global variable.
Show( age ); // age is still a global variable.