I am brand new to JMP scripting and trying to self teach. I created a radio box:
New Window( "Example",
panelbox("Confidence Interval",
rb = Radio Box(
{"90%", "95%", "98%", "99%"},
Show( rb << Get() ),
),
My current question is how can I use the variable rb?
I tried this if(then) statement:
If(
:rb == "95%",
// then
:x = 1.96,
:rb == "90%", :x = 1.645,
:rb == "98%", :x = 2.326,
:rb == "99%", :x = 2.576,
)
but get this error message: "Name Unresolved: rb in access or evaluation of 'rb' , :rb/*###*/"
Here is the whole code.
Names Default To Here( 1 );
computeResults = Expr(
If(
:rb == "95%",
// then
:x = 1.96,
:rb == "90%", :x = 1.645,
:rb == "98%", :x = 2.326,
:rb == "99%", :x = 2.576,
)
);
New Window( "Example",
Panel Box( "Confidence Interval",
rb = Radio Box(
{"90%", "95%", "98%", "99%"},
Show( rb << Get() ),
),
),
H Center Box( Button Box( "Calculate Minimum Sample Size", computeResults ) ),
V List Box( Text Box( "" ), ciolb = Panel Box( "Result", x = Number Edit Box( "" ) ) )
);
Thanks for any help or suggestions. I'll be reading the scripting manual and check back later.