cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to move from signal modeling to system modeling at the first JMP Aerospace Analytics webinar. Register. June 18, 1 p.m. US Eastern Time.

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