cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Kirk_A
Level II

How to use Radio Boxes

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.

 

12 REPLIES 12
Kirk_A
Level II

Re: How to use Radio Boxes

I think I have an understanding of what is going on. Hopefully LAST question.

 

If I set a variable say x = 3 it looks like I can "reset" x later to say x = z+ y without an error (syntax error at least). Am I correct?

txnelson
Super User

Re: How to use Radio Boxes

You can do that. But in your case, since x is use in your display window, you need to understand that x will no longer point to the numbereditbox
Jim
Kirk_A
Level II

Re: How to use Radio Boxes

Yep, I see that. I just wanted to verify the theory. Thanks again.