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 create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

Set Value as Global Variable

Hi,

I want to update a NumberColEditBox in a report using global variables.  I have tried various combinations of Eval and Parse, but without success.  I am using JMP9.

/*

// This command works:

reportX[ NumberColEditBox( 1 ) ] << Set Values( [ 1, 2, 3, 4 ] );

// These commands do not work, and generate an "Invalid matrix token" error:

a = 1;

b = 2;

c = 3;

d = 4;

reportX[ NumberColEditBox( 1 ) ] << Set Values( [ a, b, c, d ] );

reportX[ NumberColEditBox( 1 ) ] << Set Values( Eval( [ a, b, c, d ] ) );

reportX[ NumberColEditBox( 1 ) ] << Set Values( [ Eval( a) , Eval( b ), Eval( c ), Eval( d ) ] );

reportX[ NumberColEditBox( 1 ) ] << Set Values( Eval( Parse( [ a, b, c, d ] ) ) );

*/


I suspect my problem is with difficulty putting Global Variables into a matrix.


Any help is appreciated!  Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Set Value as Global Variable

You can evaluate and convert a list into matrix using Matrix(List).

// JMP 9

nw=new window("test", ncb=numbercoleditbox("ncb",[1,1,1,1]));

L={a,b,c,d}={1,2,3,4};

M=matrix(evallist(L));

ncb<<setvalues(M);

// JMP 10

// It's easier in JMP 10 where <<set  accepts a list directly.

// Nr of rows also changes automatically in JMP10

nw=new window("test", ncb=numbercoleditbox("ncb",[1]));

L={a,b,c,d}={1,2,3,4};

ncb<<set(L);


View solution in original post

2 REPLIES 2
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Set Value as Global Variable

You can evaluate and convert a list into matrix using Matrix(List).

// JMP 9

nw=new window("test", ncb=numbercoleditbox("ncb",[1,1,1,1]));

L={a,b,c,d}={1,2,3,4};

M=matrix(evallist(L));

ncb<<setvalues(M);

// JMP 10

// It's easier in JMP 10 where <<set  accepts a list directly.

// Nr of rows also changes automatically in JMP10

nw=new window("test", ncb=numbercoleditbox("ncb",[1]));

L={a,b,c,d}={1,2,3,4};

ncb<<set(L);


robot
Level VI

Re: Set Value as Global Variable

Works great.  Thanks!

Recommended Articles