cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
] />

Discussions

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

why ::labelslist ?

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );

labelsList = {"F" = "A", "M" = "B"}; //here namespace
::labelsList = {"F" = "①", "M" = "②"}; // global variable
f = function ({},
	{default local},
	labelsList = {"F" = "X", "M" = "Y"} ; // local variable
	dt:sex  << Set Property( "Value Labels", labelsList ) // which variable will JMP pick?
);

f

JMP 19.1:  ①,②
JMP 18.2.2 & JMP 20EA: X,Y

workarounds:  

  • use dt:sex <<Value Labels( labelsList )
  • use Eval (Eval Expr( ... Expr (labelslist)    ))
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: why ::labelslist ?

JMP19 maybe does the evaluation in the data table which is why global value is being used. You can question should that evaluation happen at all

The column stores the column property with the values supplied without evaluation or validation of the supplied arguments. In order to add column properties that contains variables using JSL code, the script must convert any variables to their actual values.  Scripting Guide > Data Tables > Work with Columns > Set or Get Column Properties 

You can also make JMP crash with JMP19 if you wrap your variable with {} (JMP18 won't crash and you will get attempt to assign error).

-Jarmo

View solution in original post

3 REPLIES 3
hogi
Level XIII

Re: why ::labelslist ?

much more difficult to understand was the initial error message:

Unbenannt.png

delete symbols (::labelsList);

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
f = function ({},
	{default local},
	labelsList = {"F" = "X", "M" = "Y"} ; 
	dt:sex  << Set Property( "Value Labels", labelsList )
);

f
Craige_Hales
Super User

Re: why ::labelslist ?

Unknown means JMP caught an unexpected error and has no better explanation. Report it and explain what you think it should do; a developer will get a chance to fix it, either by making it work in a reasonable way or by making the message better. 

Craige
jthi
Super User

Re: why ::labelslist ?

JMP19 maybe does the evaluation in the data table which is why global value is being used. You can question should that evaluation happen at all

The column stores the column property with the values supplied without evaluation or validation of the supplied arguments. In order to add column properties that contains variables using JSL code, the script must convert any variables to their actual values.  Scripting Guide > Data Tables > Work with Columns > Set or Get Column Properties 

You can also make JMP crash with JMP19 if you wrap your variable with {} (JMP18 won't crash and you will get attempt to assign error).

-Jarmo

Recommended Articles