Command Reference : Function Reference : Function Reference: U
  
 
@uilist
 
Displays a dialog with a listbox.
Syntax: @uilist(arg, prompt, items)
arg: scalar, program variable, string, replacement variable
prompt: string
items: string
Return: integer
Displays a dialog with a listbox and prompt string that will be used to label the listbox.
arg should be an object or program variable as it is used to return results. arg is used to provide an initial selection, and will contain the dialog specified value on return.
prompt specifies the text used to label the listbox.
items is a space delimited list of items in the listbox.
Both prompt and items may be specified using in-line text.
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
See “User-Defined Dialogs” for discussion.
See also @uimlist, @uidialog, @uiedit, @uiprompt, @uiradio.