You are here: Commands > Dialog > Manually Editing Dialog Commands and Variables

Manually Editing Dialog Commands and Variables

Although Dialog commands are typically edited using the Dialog builder, there are times where may want to manually edit the Dialog command. Most commonly this will be required when you wish to manually populate a list using an automated process in a procedure via a variable or variable array. To support this, the command syntax for a list in the Dialog command can be manually edited to remove the standard label list and replace it with a variable or variable array name.

Note: Keep in mind that when this type of manual edit is made to a Dialog command, the Dialog command is no longer editable using the Dialog builder. All subsequent edits must be made manually to the Dialog syntax in your procedure.

A typical example would be manually replacing a standard label list with the name of a variable or variable array in a drop-down list. The initial Dialog command syntax would look like the following:

DIALOG (DIALOG TITLE "User Dialog" WIDTH 590 HEIGHT 479) (BUTTONSET TITLE "&OK;&Cancel" AT 370 12 DEFAULT 1) (DROPDOWN TITLE "File-A;File-B;File-C" TO "DROPDOWN1" AT 132 108 DEFAULT 3)

The example above shows the standard drop-down list syntax within a Dialog command, in this case providing a standard label list of filenames in quotes and separated by semi-colons with a specific default selection.

DIALOG (DIALOG TITLE "User Dialog" WIDTH 590 HEIGHT 479) (BUTTONSET TITLE "&OK;&Cancel" AT 370 12 DEFAULT 1) (DROPDOWN TITLE FileNames TO "DROPDOWN1" AT 132 108 DEFAULT 3)

The example above shows the manually modified drop-down list syntax within a Dialog command, where the quoted label list has been manually replaced with an un-quoted variable name FileNames. The assumption here is that the specified variable or variable array will contain the list of filenames rather than a standard label list and that the variable or variable array will be created by some earlier process in your procedure.

Tip: This type of variable substitution is valid for a variable containing items separated by semi-colons or for a variable array.

For more information on the creation and use of variable arrays, see Variable Arrays.

When the items you wish to use to populate a drop-down list are stored within a field (column) in an existing table, an easy automated way to create a variable array containing a list of these items is to open the table and then use the SAVE FIELD command to save the field data into a named variable array. For more detailed information see Save.