Radiogroup

Radiogroup
A radiogroup is a group of buttons that function together. Each has a text label and a small, round button that can be filled, or cleared. Only one in a set of radiobuttons can be checked at a time, so checking one automatically unchecks others in the group.

Multiple radiogroups may be used in a program.

The syntax to create a radiogroup is as follows.

RADIOGROUP #handle, choicesExpr$, choice$ - Insert radiobuttons defined by comma delimited choicesExpr$ with selection choice$

If choice$ is an empty string, no button is set initially.


 * RADIOGROUP methods**
 * 1) handle SELECTION$ //- Return a string expression containing the text of the currently set button//
 * 2) handle HORIZONTAL(booleanExpr) //- Lay the buttons out horizontally if booleanExpr is true (nonzero)//
 * 3) handle ISNULL //- Returns zero (or false)//
 * 4) handle DEBUG$ //- Returns the string "Radiogroup"//

The following demo creates a radiogroup, then retrieves the text of the selected button.

code format="vbnet" radiogroup #rad, "Red, Green, Blue", "Blue" sel$ = #rad selection$ print sel$ code

The following demo creates a radiogroup and causes the layout to be horizontal.

code format="vbnet" radiogroup #rad, "Red, Green, Blue", "Blue" 'horizontal layout code
 * 1) rad horizontal(1)

The following demo creates two radiogroups. It causes the first radiogroup to be laid out horizontally. The second radiogroup is created with no button set.

code format="vbnet" radiogroup #rad, "Red, Green, Blue", "Blue" print:print "-" radiogroup #rad2, "Small, Medium, Large", "" code
 * 1) rad horizontal(1)
 * 1) rad2 horizontal(0)

This code demonstrates the **Debug$** and **IsNull** methods.

code format="vbnet" print "Before creation, IsNull returns:" print #rad isnull print radiogroup #rad, "Red, Green, Blue", "Blue" print print "Object is a ";#rad debug$ print print "After creation, IsNull returns:" print #rad isnull wait code

Practical implementation of radiogroup.

code format="vbnet" radiogroup #rg1, "Button 1,Button 2,Button 3", "Button 1" link #go, " [Submit]", [go] wait [go] sel$ = #rg1 selection$ print:print print sel$;" is selected" wait code
 * 1) rg1 horizontal(1)