It turns out that the Substr() function does not work across the selected rows(not sure why), so I changed up the code a bit and tested it out(I obviously had not tested my last version)
Names Default To Here( 1 );
dt = Data Table( "Example Data" );
col_dlg = New Window( "Column Select",
Panel Box( "Select columns to create NonDetect table with",
col_clist = Col List Box( all, width( 200 ) ),
Button Box( "Ok",
selected_column_list = col_clist << getselected;
dt2 = dt << Subset( Output Table( "NonDetect" ), columns( selected_column_list ) );
// Loop across the columns in the new data table and convert them to numeric
// Cells with nonnumeric values will be set to Missing Values, which then can
// be identified and set to 0
For( i = 1, i <= N Items( selected_column_list ), i++,
// Select all of the currently non selected columns and unselect the current ones
dt2 << select where( Contains( As Column( dt2, selected_column_list[i] ), "<" ) == 0 );
// Set for the target column all of the currently selected rows to "0"
Column( dt2, selected_column_list[i] )[dt2 << get selected rows] = "0";
// Find the rows with the "<" in them
dt2 << invert row selection;
selRows = dt2 << get selected rows;
//selRows= dt2 << Get Rows Where(Contains(As Column( dt2, selected_column_list[i] ),"<" )==1);
// Get rid of the "<" making the value a valid numeric value
For( k = 1, k <= N Rows( selRows ), k++,
Column( dt2, selected_column_list[i] )[selRows[k]] = Substr( As Column( dt2, selected_column_list[i] )[selRows[k]], 2 )
);
// Convert the column to a numeric/continuous column
Column( dt2, selected_column_list[i] ) << data type( numeric ) << modeling type( continuous );
);
col_dlg << close window;
)
)
);
Jim