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
Andyon98
Level III

How do you append a list onto a col list box?

The syntax is causing me confusion, I tried something similar as below. However it does not work.

colbox << append(dt << mylist);
4 REPLIES 4
txnelson
Super User

Re: How do you append a list onto a col list box?

Here is an example I took from the Scripting Index with a little modification to show you what you want

Names Default To Here( 1 );
New Window( "Example",
	fontobj = lb = List Box({},
		width( 200 ),
		max selected( 2 ),
		nlines( 6 )
	)
);

theList = {"First Item", "Second Item", "Third Item"};
lb << Append( theList );
Jim
Andyon98
Level III

Re: How do you append a list onto a col list box?

That works correctly - in my application I have a list of lists but it wont work for some reason. See your code below slightly edited.

Names Default To Here( 1 );
New Window( "Example",
	fontobj = lb = List Box({},
		width( 200 ),
		max selected( 2 ),
		nlines( 6 )
	)
);

theList = {{"First Item", "Second Item", "Third Item"},{"Fourth Item", "Fifth Item", "Sixth Item"}};

//Im trying to pull the second list from the list of lists for(i=1, i=3, i++, lb << Append( theList[2][i] ); );

 

txnelson
Super User

Re: How do you append a list onto a col list box?

Your For Loop is in error.  It should be

for(i=1, i<=3, i++, 
lb << Append( theList[2][i] );
);
Jim
ErraticAttack
Level VI

Re: How do you append a list onto a col list box?

No need to loop:

Names Default To Here( 1 );
New Window( "Example",
	fontobj = lb = List Box({},
		width( 200 ),
		max selected( 2 ),
		nlines( 6 )
	)
);

theList = {{"First Item", "Second Item", "Third Item"},{"Fourth Item", "Fifth Item", "Sixth Item"}};
//Im trying to pull the second list from the list of lists
lb << Append( theList[2] );
Jordan

Recommended Articles