cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
How to script Column Properties using variables

Overview

When using the JMP® Scripting Language (JSL) to script a column property, it is important to understand that the column is simply a repository for all column properties. The column stores the column property with the values supplied without evaluation or validation of the supplied arguments. In order to add column properties using JSL code which contains variables, the script must convert any variables to their actual values.

One way to do this is to use expressions. In the following example, the Eval Expr() function evaluates and replaces any variable wrapped in the Expr() function with its value. The outer Eval() function evaluates the entire statement after the replacement has occurred.

 

Instructions

In a JMP session, click the File menu and select New ► Script. Copy the below script and paste it into the script window. To run the sample script, click the Edit menu and select Run Script.

/* Open a sample data table */ 
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

/* Assign desired spec limits */
lLimit = 55;
uLimit = 70;
tLimit = 62.5;

/* Store the limits in the Spec Limits column property */ 
Eval(  //Evaluates the entire expression after the replacement has occurred
	Eval Expr(  //Evaluates and replaces any variable wrapped in the Expr() function with its value
		:height << Set Property(
			"Spec Limits",
			{LSL( Expr( lLimit ) ), USL( Expr( uLimit ) ), Target( Expr( tLimit ) ), Show Limits( 0 )}
		)
	)
);

 

Additional Documentation

More information about the JMP Scripting Language can be found in the JMP Scripting Guide. You can access the guide from within JMP by clicking on the Help menu and select JMP Help.  From the online Table of Contents, choose Scripting Guide.

 

[Previously JMP Note 46953]

Details
Operating System
macOS Windows
Products JMP JMP Pro