Radio Button Syntax

Syntax

([%Directives%]Variable_Name=Choices[!Event][?Enabled])

Argument

Type

Description

%Directives%

 

Refer to Xdialog Language Directives and Operators.

()

C

The leading ( and trailing ) characters are required.

Variable_Name

C

The name of a character variable to receive the user selection, or a numeric variable to receive the index value of the selected radio button. The index of the top-most button is 1.

Choices

C

See Choices Syntax.

Event

C

Optional. See Event Syntax.

Enabled

C

Optional. See Enabled Syntax.

Description

One or more Radio Button objects may appear inside the Format section of a UI_DLG_BOX() function. If you are testing the value of the selected radio button, it is advisable to use ALLTRIM().

Example

The following script displays a dialog with three radio buttons: [Picture]

mode = 1

result=ui_dlg_box("Title",<<%dlg%

Filename: [.32filename];

Open as? ;

(mode={Shared,Read only,Exclusive});

<OK>

%dlg%, <<%code%

if a_dlg_button = "mode" then

    if (alltrim(mode) = "Shared") then

        do something

    end if

end if

%code%)

The next script uses a CR-LF delimited list of choices. [Picture]

choices = "Shared" + crlf() + "Read only" + crlf() + "Exclusive"

mode = 2

result=ui_dlg_box("Title",<<%dlg%

Filename: [.32filename];

Open as? ;

(mode=choices);

<OK>

%dlg% )

The next script uses an array of choices.

dim result as N

dim choices[3] as C

choices[1] = "Shared"

choices[2] = "Read only"

choices[3] = "Exclusive"

mode = 3

result=ui_dlg_box("Title",<<%dlg%

Filename: [.32filename];

Open as? ;

(mode=choices);

<OK>

%dlg% )

See Also

Xdialog Language Directives and Operators, Xdialog Control Reference

Supported By

Alpha Five Version 5 and Above