Choose Language Hide Translation Bar
Highlighted
ERoderz
Level II

Label a column via scripting?

I'm trying to label a column via JSL, but all I can find help for is Code to label specific rows based upon conditions. I've tried a couple approaches but was thinking this would work, but it doesn't...

dt:Column("Day #") << Set labelled; or dt:"Day #" << Set labelled

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: Label a column via scripting?

To set the Label property for a column, use the following

dt << set label columns (:Day #)

  Documented in

       Help==>Scripting Index 

Jim

View solution in original post

4 REPLIES 4
Highlighted

Re: Label a column via scripting?

The correct message is Label. The opposite effect uses the Unlabel message. Send the message to the data column, not the data table.

Learn it once, use it forever!
Highlighted
Turbo2020
Level I

Re: Label a column via scripting?

Hi Mark,

This should be straight forward, but somehow I'm not able to get the Unlabel to work.

Can you please help enlighten me?

 

dt = Current Data Table();

//Works fine to Label
:name("ID") << Label;
:name("ID") << Set Labelled;
dt << Set Label Columns( :ID );

//Doesn't work to Label
:name("ID") << Set Label;

//Doesn't work to use Unlabel
:name("ID") << Unlabel;
:name("ID") << Set Unlabel;
:name("ID") << Set Unlabelled;
dt << Set Unlabel Columns( :ID );

Thanks!

 

Highlighted
txnelson
Super User

Re: Label a column via scripting?

names default to here(1);
dt = Open("$SAMPLE_DATA/big class.jmp");
:name << label(1);

wait(5);

:name << label(0);

Look in the Scripting Index for syntax for items like this. 

Jim
Highlighted
txnelson
Super User

Re: Label a column via scripting?

To set the Label property for a column, use the following

dt << set label columns (:Day #)

  Documented in

       Help==>Scripting Index 

Jim

View solution in original post

Article Labels

    There are no labels assigned to this post.