radio buttons

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

radio buttons

Post by Mark Gevry » Sun May 29, 2005 4:05 am

How do i get which radio button is on...

Like...

if>Dialog1.radiobutton=checked,dosomethihng...how do you tell which one is check? Mines set up like this

(radio)1 Token
(radio)2 Tokens
(radio)3 Tokens
(radio)4 Tokens
(radio)5 Tokens

then do like this..
if 5 tokens = check then do something

Methuselah
Junior Coder
Posts: 49
Joined: Fri Oct 15, 2004 8:42 am
Location: Johannesburg, South Africa

Referencing Radio Buttons

Post by Methuselah » Mon May 30, 2005 2:44 pm

I concur - it is not that obvious - even tho it is mentioned in the Help ... under Dialog. F11 properties does not give you a clue either.

Try this one on for size .... ;-)
...
RadioGroup=msRadioGroup1,msRadioGroup1,128,72,97,113,One%CRLF%Two%CRLF%Three,-1
...
Show>myDialog,result
Messagemodal>Result=%result%%CRLF%RadioValue=%myDialog.msRadioGroup1%

You refer to the name of the Radiogroup of the dialog. (Dialog.RadioGroupName)
It is set to the caption "list" value selected , e.g. "Two".

Meths

Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

Post by Mark Gevry » Mon May 30, 2005 4:14 pm

So....i still dont get it..like if the radio button "1 token" is on, do a specific task. How would i do that?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon May 30, 2005 6:28 pm

Here is an rough example that will show radionbuttons.

Code: Select all

Dialog>Dialog3
   Caption=Dialog3
   Top=269
   Width=451
   Left=65
   Height=250
   RadioGroup=TokenGroup,Choice,96,32,185,105,1 token%CRLF%2 tokens%CRLF%3 tokens,-1
   Button=OK,144,144,75,25,0
EndDialog>Dialog3
Show>Dialog3,result

If>%Dialog3.TokenGroup%=2 tokens,Here,There
There really is no example in the Help section.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

-=DJ=-
Newbie
Posts: 18
Joined: Sun Mar 27, 2005 10:32 pm

Post by -=DJ=- » Fri Jun 03, 2005 12:04 pm

Here you go hope this helps.


Dialog>select_dialog
Caption=Tokens
Top=223
Width=123
Left=407
Height=187
RadioGroup=msRadioGroup1,Select Bet,8,8,97,97,1 Token%CRLF%1 Tokens%CRLF%3 Tokens%CRLF%4 Tokens%CRLF%5 Tokens,-1
Button=GO,16,112,81,25,1
EndDialog>select_dialog

show>select_dialog,r
if>r=1,get bet
if>r=2,exit

label>get bet
goto>%select_dialog.msRadioGroup1%

label>1 Token
//do something
goto>main program

label>2 Tokens
//do something
goto>main program

label>3 Tokens
//do something
goto>main program

label>4 Tokens
//do something
goto>main program

label>5 Tokens
//do something
goto>main program

label>main program
//main script here

label>exit

Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

Post by Mark Gevry » Sat Jun 04, 2005 3:22 am

Yeah, Dj, Thanks! (This is marky by the way :wink: )

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts