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
aharro
Level II

Storing object references in a list

Has anyone ever noticed when you store multiple object referances in a list you won't actually get the object referance....?

e.g.

 

Namesdefault to here(1);

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder( Variables( X( :height ), Y( :weight ) ), Elements( Points( X, Y ), Smoother( X, Y ) ) );

list = {};
list2 = {};

Insert Into(list, {gb, "test", "test2"});

Insert Into(list2, gb);

show(list[1]);

show(list2[1]);

show(gb);

 

 

output:
list[1] = gb;
list2[1] = Graph Builder[];
gb = Graph Builder[];

The first list gives you the variable name. Not usefull to make calls on.


1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Storing object references in a list

Use Eval List() (Scripting Guide > Data Structures > Lists in JSL Scripts > Evaluate Lists )

 

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Variables(X(:height), Y(:weight)),
	Elements(Points(X, Y), Smoother(X, Y))
);

list = {};
list2 = {};

Insert Into(list, Eval List({gb, "test", "test2"}));

 

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Storing object references in a list

Use Eval List() (Scripting Guide > Data Structures > Lists in JSL Scripts > Evaluate Lists )

 

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Variables(X(:height), Y(:weight)),
	Elements(Points(X, Y), Smoother(X, Y))
);

list = {};
list2 = {};

Insert Into(list, Eval List({gb, "test", "test2"}));

 

 

-Jarmo
aharro
Level II

Re: Storing object references in a list

You made that look too easy. Thanks!

Recommended Articles