To select a column, use the Set Selected message.
col << Set Selected( 1 );
For example, to select all continuous variables in the Big Class.jmp sample data table, use the following script:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
cc = dt << Get Column Names( "Continuous" );
ncols = N Items( cc );
For( i = 1, i <= ncols, i++,
cc[i] << Set Selected( 1 )
);
To get a list of currently selected columns, use the Get Selected Columns message.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:age << Set Selected( 1 );
:sex << Set Selected( 1 );
dt << Get Selected Columns();
{:age, :sex}
Return the list of selected columns as a string using the "string" argument:
dt << Get Selected Columns( "string" );
{"age", "sex", "height"}
To actually select the columns before getting the columns, send the Set Selected message to a column. For more information, see Column Attributes.
To select and move to a specific column, use the Go To message.
dt << Go To( column name | column number );
dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );
dt << Go To( 1 );