cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

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