cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

Passing outer variables into Add Graphics Script() in Graph Builder

I am encountering an issue while programming in JMP's JSL language. When I use the `Add Graphics Script()` function to customize a Graph Builder, outer-scope variables are not passed to the script as values at the time of addition, which leads to errors. I have tried using the `Eval()` function to convert variables into their values, but `Add Graphics Script()` passes the `Eval()` call itself into the Graph Builder, and the error persists. Is there a proper way to inject the current values of external variables into the script so that they are evaluated correctly within the Graph Builder context?

Names Default To Here( 1 );
rpt = Current Report();
cc = 1;
rpt[Frame Box( 1 )] << Add Graphics Script(
	1,
	Description( "" ),
	Text( Center Justified, {0, 0}, cc )
);

AggregateHare95_0-1781837815928.png

Name Unresolved: cc in access or evaluation of 'cc' , cc/*###*/

1 REPLY 1
jthi
Super User

Re: Passing outer variables into Add Graphics Script() in Graph Builder

You have to evaluate it inside the graphic script. Below is one option using EvalExpr (Substitute is also a good option).

Names Default To Here(1);

rpt = Current Report();

cc = 1;

Eval(Eval Expr(
	rpt[Frame Box(1)] << Add Graphics Script(
		1, 
		Description(""), 
		Text(Center Justified, {0, 0}, Expr(cc))
	)
));
-Jarmo

Recommended Articles