Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
Jazib
Level II

Variables in Graphics Script

Hi everyone.

 

I have variables in my graphics script. I can't post the exact script but I have something like:

 

temp = Expr(

// Graphics Script with variables, I have wrapped these variables around Eval()

);

...

Add Graphics Script (temp);

 

The issue is that the graphics script doesn't work when the window updates. I looked at the script using "Customize" and it just shows "temp".

 

So I tried:

framebox << Add Graphics Script(Eval Expr(temp));
framebox << Add Graphics Script(Eval(Eval Expr(temp)));

 

as well as a few other things but nothing worked. I also tried directly putting the graphics script without the Expr and temp in the <<Add Graphics Script message but that gives errors because it has variables unknown to the framebox.

 

I am using the first method in the Accepted solution to this: Adding & Removing Graphics Scripts 

 

I wanted to use the second but it didn't work because it assumes constants and I have variables.

 

Also looked at this but it didn't help: https://www.jmp.com/support/notes/55/553.html

 

Tried my best to give as many details as possible but sorry I can't post the code!

 

One last note is that this is all inside a Class method. Not sure if that makes a difference in this case.

 

Does anyone know a solution?

 

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
ih
ih
Level VII

Re: Variables in Graphics Script

Check out the article below for a few ways to accomplish this.  You are on the right track, but you need to construct it like this:

 

Eval( Eval Expr(
  framebox << Add Graphics Script( Expr( temp ) )
) );

Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute

View solution in original post

3 REPLIES 3
Highlighted
ih
ih
Level VII

Re: Variables in Graphics Script

Check out the article below for a few ways to accomplish this.  You are on the right track, but you need to construct it like this:

 

Eval( Eval Expr(
  framebox << Add Graphics Script( Expr( temp ) )
) );

Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute

View solution in original post

Highlighted
Jazib
Level II

Re: Variables in Graphics Script

Thanks, I'll check out the article. But for some reason that didn't add the script to the frame box. I checked "Customize" and the script wasn't there.
Highlighted
Jazib
Level II

Re: Variables in Graphics Script

Nevermind, that worked! I had a mistake in the code, haha. Thank you so much!

Article Labels