Now change the existing value of the string using Set Table Variable or New Table Variable, and then use Get Table Variable again to check that the string has been updated:
Suppose you want a text representation of a data table, perhaps to e-mail to a colleague or to use as part of a script. You can obtain a script that reconstructs the information in a data table with Get Script. The following example opens Big and prints the data, table variables, column properties to the log. A portion of the output is shown here:
The table script named On Open or OnOpen can be automatically run when the data table opens. Users are prompted to run the script by default. Their choice is remembered each time they open the data table in the current JMP session.
To create an On Open script, perform one of the following actions:
Create the script using the Save Script to Data Table option, and then double-click the property name and change the name to On Open.
Store the script using a New Script message.
In this example, you send the Sort message to Current Data Table() rather than dt, because dt might not be defined when the data table is opened.
On Open scripts that execute other programs are never run. As a safety precaution, you might consider suppressing automatic execution when opening data tables that you receive from others.
Note: When you create a new data table in a script and include the On Open() function, On Open() is called before the data table is created, not after.
The message Suppress Formula Eval takes a Boolean argument to specify whether formula evaluation should be suppressed or not. You might want to suppress evaluation if you plan to make numerous changes to the data table and do not want to wait for formula updates between steps.
To accomplish the same effect for all data tables, use the Suppress Formula Eval command to turn off formulas globally. This is the same as the message above, except that you do not send it to a data table object.
To force a single column to evaluate, send an EvalFormula command to the column. You can even do this inside the command to create the column, after the formula clause, as follows:
dt << Run Formulas performs all pending formula evaluations, including evaluations that are pending as a result of evaluating other formulas. This function is useful when you have a whole series of columns to run.
Tip: This method is preferred over EvalFormula. Although EvalFormula evaluates the formulas, it does not suppress the background task from evaluating them again. The background task takes great care to evaluate the formulas in the right order.
If you send the Run Formulas command to a data column, the evaluation is done at the time of the command, but it does not suppress the scheduled evaluations that are pending. Therefore, formulas might end up being evaluated twice if you also send the command to the data table and the data column. Being evaluated twice might be desirable for formulas that have random function in them, or it might be undesirable if they depend on randomization seeds being set. If you use random numbers and use the Random Reset(seed) feature to make a replicable sequence, then use the Run Formulas command, because it avoids a second evaluation.
Note: All platforms send a Run Formulas command to the data table to assure that all formulas have finished evaluating before analyses start.
col << Set Each Value(expression) evaluates the expression for each row of the data table and assigns the result to the column. It does not store the expression as a formula.