Syntax: @uilist(IO_Selectitem, prompt_string, listbox_items)
Argument 1: string or scalar select_item
Argument 2: string, prompt_string
Argument 3: string, listbox_items
Return: integer
Displays a dialog with a listbox and prompt string. Fill the listbox by specifying listbox_items, a space delimited list of items. prompt_string specifies the text to be used as a label for the listbox. Initialize the listbox selection with IO_Selectitem, which may be either a string or scalar, and which will return the selection value on exit of the dialog.
Both prompt_string and listbox_items may be specified using in-line text, but IO_Selectitem must be either a program variable or an object in your workfile as it is used to return results.
The dialog shows an OK and Cancel button, and will return an integer representing the button clicked: Cancel (-1), OK (0).
Examples
string selection = "Item2"
@uilist(selection, "Please select an item:", "Item1 Item2 Item3")
These commands display a dialog with a listbox containing the items “Item1”, “Item2”, and “Item3”. The title “Please select an item:” appears above the listbox, and the second item is initially selected. If the user selects the third item and presses OK, the string SELECTION will contain “Item3”, and the dialog will return the value 0.
Similarly,
scalar sel = 3
@uilist(sel, "Please select an item:", "Item1 Item2 Item3")
brings up the same dialog with the third item selected. The scalar SEL will contain the user’s selection if OK is pressed.
Cross-references