- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How can I append to this Col List Box?
This code is supposed to add each name into the list box but it doesn't work. Has it got to do with the data type?
Also, if you're wondering why im using the 1st element, its because I wanted to populate other columns within that list for E.G -> col[2] = column(dt, "height");
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col = {};
col[1] = column(dt, "name");
New Window( "Col List Box Example",
LstBox = Col List Box(, width( 250 )),
for(i=1, i<= N Rows(dt), i++,
LstBox << append(Eval(col[1][i]));
),
);
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How can I append to this Col List Box?
The issue is that you are using
Col List Box()
and attempting to place non column names into the list.(i.e. Katie, Louise, etc. are not column names)
To do what you want, you need to use
List Box()
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col = {};
col[1] = column(dt, "name");
New Window( "List Box Example",
LstBox = List Box(, width( 250 )),
for(i=1, i<= N Rows(dt), i++,
LstBox << append(Eval(col[1][i]));
),
);
Jim
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How can I append to this Col List Box?
Col List Box is used for Columns. If you want to add names in the name column, you should use List Box:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col = {};
col[1] = column(dt, "name");
New Window( "Col List Box Example",
LstBox = List Box(, width( 250 )),
for(i=1, i<= N Rows(dt), i++,
LstBox << append(Eval(col[1][i]));
),
);
-Jarmo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How can I append to this Col List Box?
The issue is that you are using
Col List Box()
and attempting to place non column names into the list.(i.e. Katie, Louise, etc. are not column names)
To do what you want, you need to use
List Box()
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col = {};
col[1] = column(dt, "name");
New Window( "List Box Example",
LstBox = List Box(, width( 250 )),
for(i=1, i<= N Rows(dt), i++,
LstBox << append(Eval(col[1][i]));
),
);
Jim