Subscribe Bookmark RSS Feed

How to pass a variable (string type) to different JMP elements

euge

Community Trekker

Joined:

Sep 5, 2012

Hello all,

I've been trying for a couple of days to figure out if there's a way to pass a variable to radio box, so that it shows up as an option.  For instance in the bottom piece of code, I'm getting a radiobox that shows "FirstGroup" and "SecondGroup" as options, instead of "SampleA" and "SampleB".

FirstGroup = "SampleA";

SecondGroup = "SampleB";

New Window (<<Modal,

     vlistbox(

          Textbox("Select group"),

          rb_box1= RadioBox( {FirstGroup,SecondGroup}),

          Vlistbox(Button Box("Ok"),Button Box("Cancel"))

     );

);

It seems like in other situaitons, it's okay to pass a string variable by just calling it ...for instance, when plotting a graph, the appropriate substitution is made, and the title shows "SampleA vs SampleB"...

Bivariate(

     Y(:Result),

     X(:Group),

     title(FirstGroup || "vs" || SecondGroup),

     ...

It turns out there are other places where calling a variable is a bit hokey...further down in the same code, when I try to fit lines, JMP correctly separates the groups to draw the fit lines, but on the graph displays "FirstGroup" and "Second Group", rather than "SampleA and SampleB"

     Fit where(

     :GROUP == FirstGroup,

     Fit Special(...)

     :GROUP == SecondGroup

     Fit Special(...)

I've tried a couple other things, such as using the eval() function to force JMP to recognize the text as a variable vs text, but that doesn't seem to work either.  If anyone has any suggestions, that would be great.

Thanks in advance,

Euge

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Each JSL function seem to follow it's own rule of variable evaluation. Probably not true, but sometimes I think that all these utility functions Eval(), Eval Expr(), Eval List() etc. seem to have been invented as workarounds for JSL disparate logical rules.

Anyway, try using Eval List() in the first example with the Radiobox:

FirstGroup = "SampleA";

SecondGroup = "SampleB";

New Window (<<Modal,

     vlistbox(

          Textbox("Select group"),

          rb_box1= RadioBox( evallist({FirstGroup,SecondGroup})),

          Vlistbox(Button Box("Ok"),Button Box("Cancel"))

     );

);

2 REPLIES
Solution

Each JSL function seem to follow it's own rule of variable evaluation. Probably not true, but sometimes I think that all these utility functions Eval(), Eval Expr(), Eval List() etc. seem to have been invented as workarounds for JSL disparate logical rules.

Anyway, try using Eval List() in the first example with the Radiobox:

FirstGroup = "SampleA";

SecondGroup = "SampleB";

New Window (<<Modal,

     vlistbox(

          Textbox("Select group"),

          rb_box1= RadioBox( evallist({FirstGroup,SecondGroup})),

          Vlistbox(Button Box("Ok"),Button Box("Cancel"))

     );

);

euge

Community Trekker

Joined:

Sep 5, 2012

Awesome, that worked great!!!

Now I regret not having posted this question earlier instead of beating my head against the wall...

My forehead and I thank you wholeheartedly...