Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
john_madden
Level V

Use result of Get Format to set format of different column

How do I use the result of a << Get Format message to set the format of a different column?

f = :Column 1 << Get Format;

// the following don't work
:Column 2 << Set Format( f );
:Column 2 << Set Property( f );

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
john_madden
Level V

Re: Use result of Get Format to set format of different column

Figured out a solution:

f = :Column 1 << Get Format;
Show( f );
// f = Format("Fixed Dec", 5, 1)
a = Arg( f, 1);
b = Arg( f, 2);
c = Arg( f, 3);

d = Arg( f, 4); :Column 2 << Format( a, b, c, d ) // applies the format to Column 2

 If you ask for more Arg()'s than the format contains, Arg returns Empty(). Redundant/extraneous Empty()'s don't seem to cause a problem when applying the format to Column 2, fortunately.

Looks to me like four Arg()'s are enough to accommodate pretty much any possible format.

 

 

View solution in original post

1 REPLY 1
Highlighted
john_madden
Level V

Re: Use result of Get Format to set format of different column

Figured out a solution:

f = :Column 1 << Get Format;
Show( f );
// f = Format("Fixed Dec", 5, 1)
a = Arg( f, 1);
b = Arg( f, 2);
c = Arg( f, 3);

d = Arg( f, 4); :Column 2 << Format( a, b, c, d ) // applies the format to Column 2

 If you ask for more Arg()'s than the format contains, Arg returns Empty(). Redundant/extraneous Empty()'s don't seem to cause a problem when applying the format to Column 2, fortunately.

Looks to me like four Arg()'s are enough to accommodate pretty much any possible format.

 

 

View solution in original post

Article Labels

    There are no labels assigned to this post.