The easiest way to refer to a column is by its name. If you have a global variable and a column with the same name, to prevent ambiguity, scope the column name with the : prefix operator.
myGlobal = :age; // store the age as a variable
:age; // returns 14, the age in row 16
Show( :age ); // returns age = 14;
To get the value of a cell in a specific row, include the column name and row number. Both of the following examples return 13, the value of age in row 12 of Big Class.jmp:
:age[12];
myGlobal = :age[12];
To get a value in a data column reference, use Column() and As Column() to get the value in a data column reference. For more information, see Access Cell Values through Column References.
•
|
An empty subscript, such as :age[ ], refers to the current row.
|
•
|
Be careful that you are subscripting to a table row that exists. The default row number is zero, so statements like :name that refer to row zero generate an Invalid Row Number error.
|