Xbasic

UI_GET_LIST Function

Syntax

Result_String as C = UI_GET_LIST(C title,C default_choice,C choice1[,C choice 2,...])

Arguments

title

The title of the dialog box.

default_choice

Determines which entry is selected when the dialog box first appears. Can be a number (between 1 and 8), or a string (one of the choices). For example, if the Default Choice is 3, the third listbox entry is highlighted when the dialog box appears.

choice1

The text for the first list entry.

choice

Optional. Text descriptions for up to seven additional list items.

Description

UI_GET_LIST() creates and displays a dialog box containing between 1 and 8 listbox choices. Your response is returned as a Result_String that contains the text of the listbox entry that you highlighted before you clicked the dialog box's OK button. This function is useful for obtaining a selection from a list of items. Prompt user for selection from list.

images/UI_GET_LIST.gif

For example, a dialog box with four items in a listbox can appear with the following statement:

ui_get_list("Four Listbox Items", 3, "One", "Two", "Three", "Four")

The Result_String will be empty ("") if the Cancel button is selected.

Example

Display a list of choices and then print the selected choice in the Trace window.

choice = ui_get_list("Seating", 2, "Orchestra   $25","Floor $20", "First Balcony $20","Second Balcony $18", "Skybox $40")
if choice = "" then
    end
end if
trace.writeln(choice)

Limitations

Desktop applications only.

See Also