AskItemList

Allows the user to choose an item from a list box initialized with a list variable.

Syntax:

AskItemList( title, list variable, delimiter, sort-mode, select-mode [, selection-required] )

Parameters:

(s) title: title of the list box.

(s) list: variable a string containing a list of items.

(s) delimiter: a character to act as a delimiter between items in the list.

(i) sort-mode: @sorted for an alphabetic list. @unsorted to display the list of items as is.

(i) select-mode: @single to limit selection to one item. @multiple to allow selection of more than one item. @extended to allow selection of multiple items by extending the selection with the mouse or shift key.

(i) selection-required: [optional] @TRUE the OK button will be greyed out until an item is selected in the listbox, @FALSE default.

Returns:

(s) blank string if no items were selected, or the selected item(s).

 

This function displays a list box. The list box is filled with a list of items, sorted or unsorted, taken from a string you provide to the function. Each item in the string must be separated ("delimited") by a character, which you also pass to the function (we suggest using Tabs). The user selects one of the items by either double clicking on it, or single-clicking and pressing OK. The item is returned as a string.

If you create the list with the FileItemize or DirItemize functions your delimiter will be a tab-delimited list. For more information on delimiters see File Delimiters.

The line(s) highlighted by the user (if any) will be returned to the program. If multiple lines are selected, they will be separated by the specified delimiter. If the user does not make a selection, a null string ("") is returned.

AskItemList and AskFileText supports multiple selection up to 32,767 items.

To change the file delimiter to a character of your own choosing, using IntControl 29.

The function IntControl 63 can be used to set the coordinates for AskFileText, AskItemList and AskTextBox windows.

 

Example:

list = StrCat("Red",@TAB,"Blue",@TAB,"Yellow",@TAB,"Green")
A = AskItemlist("Colors", list, @TAB, @SORTED, @SINGLE, @FALSE)
Message("The item selected is", A)

which produces:

wila-k4_shg.gif

See Also:

AskFileText, AskFileName, IntControl 28, IntControl 29, IntControl 63