Radio Button

 

Radio Buttons are used to select one item over another.

The Variable assigned to the Radio Button should be the same for each of the choices but the Values should be different.

For example, the script in a Dialog may look like:

 

MyDialog003=`33,9,84,14,RADIOBUTTON,"Radio_Blues",music,"Blues",1,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

MyDialog004=`33,31,84,14,RADIOBUTTON,"Radio_Jazz",music,"Jazz",2,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

 

The Variable "music" is the same on both lines but the Text and the Value attributes are different.

Note: Radio Button cannot have a value of 0.

To test the return value, the variable can be placed in an If structure.

 

If music == 1

   Message("Music", "Let's play the blues.") 

else

   Message("Music", "Let's play the Jazz.") 

endif

 

Don't limit yourself to using if/endif statements. The Switch structure provides a more efficient way to test multiple values. For more information on Switch, see the Windows Interface Language help file.

 

image\radio.gif

 

 

Control Attributes

 

Calendar

Check Box

Com Control

DateTime

Drop-down Combo Box

Edit Box

File List Box

Group Box

Item List Box

Menu Bar

Menu Item

Multiline Edit Box

Picture

Picture Button

Push Button

Radio Button

Report View

Spinner

Static Text

Variable Text

 

 

For example, the line in the script generated by the WIL Dialog Editor may look like:

 

MyDialog003=`065,054,041,010,RADIOBUTTON,"Radio_1",MyRadioVar,"Radio 1",1,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT`