cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

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

Using Character Variables with SetData in Tree Nodes

I hope to use "Set data" to configure the information in the tree node. However, the variable usage does not meet my expectations. As shown in the JSL below, I want to record the text "Test" in the variable Title and set it into C1, so that Show(C1) displays as C1 << Get Data = {"Test", "", 1};
The results of using a variable (C1 situation) and directly using text data (C2 situation) for setData differ, which leads to errors when I later attempt to retrieve the data. How can I use a variable to set data so that I can obtain the same result as directly setting "Test" with setData?

 

Title = "Test";
C1 = Tree Node( Title );
C1 << SetData( {Title, "", 1} );
Show( C1 << Get Data );
Show(( C1 << Get Data )[1] );

C2 = Tree Node( "Test2" );
C2 << SetData( {"Test2", "", 1} );
Show( C2 << Get Data );
Show( (C2 << Get Data) [1] );
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Using Character Variables with SetData in Tree Nodes

You will have to evaluate the list, for example

Names Default To Here(1);

Title = "Test";
C1 = Tree Node(Title);
C1 << SetData(Eval List({Title, "", 1}));
Show(C1 << Get Data);
// C1 << Get Data = {"Test", "", 1};
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Using Character Variables with SetData in Tree Nodes

You will have to evaluate the list, for example

Names Default To Here(1);

Title = "Test";
C1 = Tree Node(Title);
C1 << SetData(Eval List({Title, "", 1}));
Show(C1 << Get Data);
// C1 << Get Data = {"Test", "", 1};
-Jarmo
BabyDoragon
Level II

Re: Using Character Variables with SetData in Tree Nodes

 
Thank you for swiftly and accurately resolving the issue I encountered.

Recommended Articles