Matrix DoDialogGetListItem( Matrix mSelection, String sTitle, String sMessage, Matrix mList )
The return value is 1 on success or 0 on failure. If the user clicks Cancel or closes the dialog box, the return value is 0.
Matrix mSelection
Upon successful return, this matrix contains the 1-based index of the item in mList that was selected by the user.
String sTitle
The title of the dialog box.
String sMessage
A message that appears at the top of the dialog box.
Matrix mList
A character vector containing the items to be displayed in the dialog box.
This module displays a dialog box that enables the user to select an item from a list.
drinks = { "Beer",
"Coffee",
"Milk",
"Orange Juice",
"Soft Drink",
"Tea",
"Wine" };
title = "Choose Beverage";
message = "Please choose a beverage from the following list:";
ok = DoDialogGetListItem( selection, title, message, drinks );
if ok then
print (drinks[selection]);
else
print "Function failed";