JMP interprets object names using name resolution. The following rules are applied sequentially to unscoped names:
1.
|
When the name is part of a script for an object, it is usually the name of an option or method in the object. For example, Show Points() is an option in the Bivariate object:
|
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Bivariate( y( weight ), x( height ) );
obj << Show Points( 1 );
2.
|
If a name is not preceded by the : scoping operator, look it up in a namespace, such as Global or Here.
|
3.
|
If a name is followed by a pair of parentheses (), look up the name as a built-in function (not a user-defined function).
|
4.
|
If a name is preceded by the : scoping operator, look it up as a data table column or table variable.
|
5.
|
If a name is preceded by the :: scoping operator, look it up as a global variable.
|
7.
|
8.
|
If a name is used as the left side of an assignment (the L-value) and Names Default To Here( 0 ) is at the top of the script, create and use a global variable.
|
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Show( :weight << Get As Matrix ); // weight resolves to a column name
Close( dt, NoSave );
Show( :weight << Get As Matrix ); // weight cannot be resolved
/* Reopen the data table */
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Show( :weight << Get As Matrix ); // weight resolves to a column name
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col = Column( dt, 1 ); // col is Column( "weight" );
Close( dt, NoSave );
/* Reopen the data table */
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Show( col << Get As Matrix ); // The reference to the first data table no longer exists.