Subscribe Bookmark RSS Feed

List as data table variable

tom_abramov

Community Trekker

Joined:

Oct 13, 2015

Hello,

I need to save the list as data table variable.

 

My List = {1,"2"}; 
DT << Set Table Variable( "The List", My List ); //doesn't work - the value of the variable is string "List"

And then, how do I assign the list to some new variable

MyNewListVariable = DT<< Get Table Variable( "The List" ); // Would it work?

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
tom_abramov

Community Trekker

Joined:

Oct 13, 2015

Solution

Thank you,

Below is the code which worked for me:

 

dt = New Table("Table");
MyList = {"A","B"};
dt << Set Table Variable("Var", Char(MyList) );
list_as_string = dt << Get Table Variable( "Var" );
list_as_list = Parse(list_as_string);

2 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

JMP Table Variables are all stored as character strings, so your list will be returned as a character string, and you will have to convert it within your application.

Jim
tom_abramov

Community Trekker

Joined:

Oct 13, 2015

Solution

Thank you,

Below is the code which worked for me:

 

dt = New Table("Table");
MyList = {"A","B"};
dt << Set Table Variable("Var", Char(MyList) );
list_as_string = dt << Get Table Variable( "Var" );
list_as_list = Parse(list_as_string);