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.
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!