cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

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