How to get names of the selected columns in string formatIn my script I use the following to get the list of all columns in a string format:
columnNames = dt << Get Column Names( string );
I need that so I could iterate through them using "For Each" loop:
For Each( {columnName, index}, columnNames, Column( dt, columnName ) << Set Name( columnName ||"SomethingHere" ) );Now I need to only get selected columns and run the same loop on them.
I know only one way to get selected columns:
columnNames = dt << Get Selected Columns;
but it returns references to columns, not string names. So when I run this then:
For Each( {columnName, index}, columnNames, Column( dt, columnName ) << Set Name( columnName ||"SomethingHere" ) );it doesn't work.
How do I either
1. Rewrite For Each loop (I'd like to keep using this loop instead of For loop) to accept references to columns as well
or
2. Convert references to columns into a list of strings.
?
Automation and ScriptingDesign of ExperimentsMass CustomizationRe: How to get names of the selected columns in string format@miguello, @jthi - JMP Technical Support will make the request to update the Scripting Index. Thank you for sharing!
Re: How to get names of the selected columns in string formatWould be good to report. I just don't remember who was supposed to be tagged when Scripting Index was lacking so for now lets tag @Jeff_Perkinson and@Ryan_Gilmore , << Get Selected Columns is missing optional option parameters in Scripting Index.
Re: How to get names of the selected columns in string formatAwesome! **bleep** under-documentation 
Re: How to get names of the selected columns in string formatAdd (String) to Get Selected Columns (not documented in scripting index... but help has "a bit more" documentation dt<) )
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Select Columns({:sex, :height});
sel_colnames = dt << Get Selected Columns(string);
show(sel_colnames); // sel_colnames = {"sex", "height"};
Re: How to get names of the selected columns in string formatOk, I solved it the following way.
Before running my already scripted "For Each" loop that I doin't want to change, I run this:
For Each( {columnName, index}, columnNames, columnNames[index] = columnNames[index]<< Get Name );Any other options?