1. Home
  2. Radio button (Genstat Resource Language)

Radio button (Genstat Resource Language)

The RADIOBUTTON Genstat resource-definition statement creates a radio button control. The control is a small circle that has the provided text displayed next to it, typically to its right. Radio buttons must be supplied in groups where only one radio button can be set at any one time. When radio buttons are grouped, selecting one radio button will automatically turn the rest of the buttons in the group off.

RADIOBUTTON text, id, x, y, width, height, flags, response text

text
The text that is displayed to the right of the radio button.

id
The id is a string used to identify controls within the resource file. If the control is to return a result to the attached Genstat procedure, this must use the same name as the procedures option or parameter that the result is for.

flags
The flags for the radio button can be one or more of the following:

GW_SEL Initially selects the radio button.
GW_OPT Specifies that the radio button is for an OPTION in the attached procedure. This is the default setting.
GW_PARAM Specifies that the radio button is for a PARAMETER in the attached procedure.

Note: only one of the flags GW_OPT or GW_PARAM can be set. To specify more than one flag use the ‘|’ character. For example, GW_SET | GW_OPT.

response text
If a radio button is selected the response text is the string that is passed to the associated Genstat procedure when it is activated.

Grouping buttons
Radio buttons are grouped together by specifying the same id for each of the buttons in the group.

Example
The following example demonstrates how to create a group of two radio buttons:

RADIOBUTTON “Estimate”, CONSTANT, 10, 10, 90, 14, GW_OPT | GW_SEL, “est”
RADIOBUTTON “Omit”, CONSTANT, 10, 30, 90, 14, GW_OPT, “omit”

See also

Updated on May 7, 2019

Was this article helpful?