The Type() function returns a string naming the type of the resulting value. For example:
Other inquiry operators (such as Is Matrix(), Is List(), Is Scriptable(), and so on) let you test for specific types of objects. In the following example, Is Matrix() evaluates as true, then the specified calculations are run:
Is Scriptable() returns 1 when the object is scriptable. Four variables in the following example refer to a data table, column, platform, and report. All four objects are scriptable, so Is Scriptable() returns 1 for each example.
Is Empty() tests to see whether a variable has a value, a function, an expression, or a reference to an object. Otherwise, you get errors when referring to something that has not been created or assigned a value yet. Programmers call this an uninitialized variable.
Here is an example of a test to see whether a data table is opened and therefore assigned to the dt variable. If a data table is not opened, the Open() function prompts the user to open the table.
You can use Is Empty() for any variable (such as global variable, local variable, and columns).
Inquiry Functions That Identify Object Types shows functions that identify object types.
Is Empty(global)
JMP provides the following functions to determine whether a file or directory is writable before attempting to write to them. Use these functions in combination with Is Directory(path) and Is File(path) to verify a script destination and attribute. See the Functions chapter in the JSL Syntax Reference book for additional information.
The Is Directory Writable(path) function returns 1 if the directory specified in the path argument is writable and 0 otherwise.
The Is File Writable(path) function returns 1 if the file specified in the path argument is writable and 0 otherwise.
The Host Is() inquiry function identifies the current operating system. Then actions specific to that operating system can be performed.
You could also use Host Is() to specify text sizes in reports for different operating systems. If you commonly write your scripts on Windows and share them with Macintosh users, the results can look different from what you intended. For example, the following expression sets the text to a larger size on Macintosh and a smaller size on Windows:
The JMP Version() inquiry function returns the JMP version as a string. You might use this function to determine the JMP version and then run a script compatible with that version.
JMP Version(); // returns "12.0.0" in JMP 12
JMP Version(); // returns " 9.0.0" in JMP 9