AskFileText

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

Syntax:

AskFileText( title, filename, sort-mode, select-mode [, selection-required] )

Parameters:

(s) title: title of the list box.

(s) filename: file containing the contents of list box.

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

(i) select-mode: @single to limit selection to one item. @multiple 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) selected item or items. If more than one item is selected it will be returned as a tab delimited list.

 

Note: This function replaces TextBox and TextBoxSort

This function loads a file into a Windows list box, either as is or sorted alphabetically, and displays the list box to the user. The line or lines highlighted by the user (if any) will be returned to the program as a tab delimited list (see ItemExtract). AskFileText has two primary uses: First, it can be used to display multi-line messages to the user. In addition, because of its ability to return selected lines, it may be used as a multiple choice question box. If the user does not make a selection, a null string ("") is returned. If disk drive and path are not part of the filename, the current directory will be examined first, and then the Environment PATH will be searched to find the desired file.

The function IntControl (63, p1, p2, p3, p4) can be used to set the coordinates for AskFileText, AskItemList and AskTextBox windows.

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

AskFileText uses the line length set by IntControl 65 (4096 characters by default).

Example:


A=AskFiletext("Contents of win.ini", "c:\windows\win.ini", @UNSORTED, @SINGLE, @FALSE)
Message("The line chosen was", A)

which produces:

wila-k3_shg.gif

See Also:

AskItemList, AskFileName, AskLine, , IntControl 28, IntControl 29, IntControl 65, IntControl 63