If you are writing such scripts, consider using explicit scoping and namespaces. See “Advanced Scoping and Namespaces” on page 252 in the “Programming Methods” chapter for more information.
When a column has been assigned to a global variable, assign a value to a cell in the column using a subscript. Suppose that the name of the column height has been assigned to the x variable:
Assign a value to the third row in the height column as follows:
注意: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.
::age = 70;
Open( "$SAMPLE_DATA/Big Class.jmp" );
Show( age ); // age is still a global variable.