Re: need sample for databaseviewer.
Posted: Sat Nov 08, 2014 3:50 am
Hi guys,
Basic Data Table Scripting
Before you can work with data table objects, you must open or create a data table, and assign a reference to the data table. This section covers the basic actions that you can perform on a data table, such as naming, saving, resizing, and so on.
Open a Data Table
Use the Open() function to open a data table.
•To simply open a data table without returning a reference to it:
Open("$SAMPLE_DATA/Big Class.jmp"); // just open the data table
•To open a data table and retain a reference to it:
dt = Open("$SAMPLE_DATA/Big Class.jmp"); // open and retain a reference
The path to the data table can be a quoted literal path (absolute or relative) or an unquoted expression that yields a pathname. Relative paths are interpreted relative to the location of the .jsl file (for a saved script). For unsaved scripts, the path is relative to your primary partition (Windows) or your <username>/Documents folder (Macintosh).
Open("../My Data/Repairs.jmp"); // relative path on Windows and Macintosh
Open("::My Data:Repairs.jmp"); // relative path on Macintosh
Open("C:/My Data/Repairs.jmp"); // absolute path
JMP provides shortcuts (path variables) to directories or files. Instead of entering the entire path to the directory or file, you include a path variable in the Open() expression. For example, JMP sample scripts typically use the $SAMPLE_DATA path variable to open files in the Samples/Data folder. For details about path variables, see Path Variables in Types of Data.
If you do not want to specify the entire path every time you open a data table, define a filepath string and concatenate the path with the filename:
myPath = "C:/My Data/Store25/Maintenance/Expenses/";
Open( myPath || "Repairs.jmp" );
Upon opening a data table, JMP stores the data table in memory. This means that if a script attempts to open a data table that is already open, the opened version appears. JMP does not read the version that is saved on your computer.
Thank you
Basic Data Table Scripting
Before you can work with data table objects, you must open or create a data table, and assign a reference to the data table. This section covers the basic actions that you can perform on a data table, such as naming, saving, resizing, and so on.
Open a Data Table
Use the Open() function to open a data table.
•To simply open a data table without returning a reference to it:
Open("$SAMPLE_DATA/Big Class.jmp"); // just open the data table
•To open a data table and retain a reference to it:
dt = Open("$SAMPLE_DATA/Big Class.jmp"); // open and retain a reference
The path to the data table can be a quoted literal path (absolute or relative) or an unquoted expression that yields a pathname. Relative paths are interpreted relative to the location of the .jsl file (for a saved script). For unsaved scripts, the path is relative to your primary partition (Windows) or your <username>/Documents folder (Macintosh).
Open("../My Data/Repairs.jmp"); // relative path on Windows and Macintosh
Open("::My Data:Repairs.jmp"); // relative path on Macintosh
Open("C:/My Data/Repairs.jmp"); // absolute path
JMP provides shortcuts (path variables) to directories or files. Instead of entering the entire path to the directory or file, you include a path variable in the Open() expression. For example, JMP sample scripts typically use the $SAMPLE_DATA path variable to open files in the Samples/Data folder. For details about path variables, see Path Variables in Types of Data.
If you do not want to specify the entire path every time you open a data table, define a filepath string and concatenate the path with the filename:
myPath = "C:/My Data/Store25/Maintenance/Expenses/";
Open( myPath || "Repairs.jmp" );
Upon opening a data table, JMP stores the data table in memory. This means that if a script attempts to open a data table that is already open, the opened version appears. JMP does not read the version that is saved on your computer.
Thank you