cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
euge
Level III

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

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
ms
Super User (Alumni) ms
Super User (Alumni)

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

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"))

     );

);

View solution in original post

2 REPLIES 2
ms
Super User (Alumni) ms
Super User (Alumni)

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

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
Level III

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

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...