cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

Issue with associative arrays and default values

Why is it not possible to specify an associative array as default value?

 

create = Function( {x},	Associative Array( {{"value", x}} )	);

create(1);
Associative Array(Eval List({ Eval List( {1, create(1)})}));   // [1 => ["value" => x]]
Associative Array(Eval List({ Eval List( {1, create(1)})}),2); // [1 => ["value" => x], => 2]


Associative Array(Eval List({Eval List( {1, create(1)})}),		create( 2 )); // empty ?!?!?

//deep dive
Associative Array({ {1, 1}},create(2)); // doesn't work
Associative Array( {1}, {1},create(2)); // works

One could argue that providing the default value during the creation of the associative array is not possible - but it works in 2 out of 4 cases.

 

hogi_0-1727335823514.png

 

1 REPLY 1
hogi
Level XIII

Re: Issue with associative arrays and default values

workaround: 

<< Set Default Value( )

Recommended Articles