Combo Box Control Syntax


[ [ Max_Chars ][. Width ] Variable_Name ^+ Choices [ ! Event ][ ? Enabled ] ]



Character. Indicates that this is an edit combo box that will show the nearest matching value based on the characters typed in.


Numeric. Optional. Default = "" (No limit). The maximum number of characters that will be returned.


Numeric. Optional. The width of the control.


Character. 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.


Character. See Choices Syntax.


Character. Optional. See Event Syntax.


Logical. Optional. See Enabled Syntax. The control is grayed out when disabled.


The value of Variable_Name is a base-1 index if the variable is declared as Numeric. If undeclared or left un-initialized, the variable is a string that returns the text of the choice that is selected.

You must not have any space characters in the finished command, except those that may be inside entries in the Choices list.
You must have an Event if you want to respond to the user's selection in the Code section of the dialog box.

The following script demonstrates a combo box in which the choices are explicitly stated by enclosing the choices between the '{' and '}' characters.

mode = "Shared"
Filename:| [.32filename];
Open as:;
Mode:| [.10 mode^+{Shared,Read only,Exclusive}];
%dlg% )

This script creates this dialog:


The following script is identical to the previous script, except that the choices displayed by the combo box come from a variable, which contains a CR-LF delimited list of choices. In addition, mode is declared as a numeric variable. Therefore, the dialog box will set its value to 1, 2, 3, or whatever the user enters.

mode = 1
choices = <<%dlg%
Read only
Filename:| [.32filename];
Open as:;
Mode:| [.10 mode^+choices];
%dlg% )

See Also