The syntax is causing me confusion, I tried something similar as below. However it does not work.
colbox << append(dt << mylist);
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 );
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"}}; <BR />//Im trying to pull the second list from the list of lists for(i=1, i=3, i++, lb << Append( theList[2][i] ); );
Your For Loop is in error. It should be
for(i=1, i<=3, i++, lb << Append( theList[2][i] ); );
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] );