cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

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