Hi
I am pretty new to JSL scripting. I cant seem to find a script to rename of a column header from one name to another
Appologies this is probably obvious to most here
Here is an example from
Help==>Scripting Index==>Data Table==>Column Scripting
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:Age << Set Name( "Time" );
Here is an example from
Help==>Scripting Index==>Data Table==>Column Scripting
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:Age << Set Name( "Time" );
Thanks alot Jim
Thats exactly what I needed. I was using a variation on that script that I had been messing around with for ages and could not make it work.
Thanks also for showing where you found it.
The script you suggest works well when a user is working with only one table. But I've been trying to change the name of a specific column within one of several tables open, and cannot find guidance within the Scripting Index. What would the JSL syntax be for this scenario?
Example
I am working with two tables (Cdt1 and Cdt2) and Cdt1 has a column with name "value" that I want to change to "Fault code"
I've tried to select the "value" column first before changing the name, but that didn't help.
Cdt1 << Select Columns("value");
Column("value") << Set Name( "Fault code" );
My other attempt was worse...
Cdt1 << Columns("value") << Set Name ("Fault code");
Either way, I haven't been successful after a while of trying and looking for guidance. Any help would be appreciated.
From the scripting index:
So your code should be:
Cdt1:value << Set Name( "Fault code" );
OR
Column( Cdt1, "value" ) << Set Name( "Fault code" );
In the future, you might find the on-line help useful. In this case:
You will find the correct syntax with arguments and options. You can run an example and observe the result. You can click Topic Help to go to the more complete coverage in the main help system.
You can also search in Objects with column name for example to find all related functions or messages.