Path variables are shortcuts to directories or files. Rather than enter the entire path to the directory or file, you use the path variable in a script. A path variable is a special type of string and is always contained within double quotation marks.
One common predefined path variable in JMP is $SAMPLE_DATA. This variable points to the sample data folder in your JMP or JMP Pro installation folder. The following example opens the Big Class.jmp sample data table.
Open( "$SAMPLE_DATA/Big Class.jmp" );
|
|||||||||
To see if the directory exists, run the script Is Directory("$ALL_HOME");. If the folder exists, 1 is returned.
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
|||||||||
|
To see the definition of any path variable, use the function Get Path Variable:
Get Path Variable( "HOME" );
Note that you don’t include a dollar sign for Set Path Variable() or Get Path Variable(). But you must include the dollar sign when using the variable in a script.
Make sure to include a trailing slash after the path variable. In the following example, the root name "Big Class" is assigned to the dtName variable. The Open() expression evaluates $SAMPLE_DATA and the trailing slash and then appends the dtName value along with the file extension .jmp.
dtName = "Big Class";
Without the slash that follows $SAMPLE_DATA, the path is interpreted as: