!PICKLIST()

!PICKLIST()

Top  Previous  Next

 

The !PICKLIST() subroutine displays a list of entries from which a user may select one.

 

 

Format

 

CALL !PICKLIST(value, list, return.col, index.col)

 

where

 

valueis the returned item. This will be returned as a null string if no option is selected.

 

listis a field mark delimited list of items to process. The display can show multiple items for each entry (e.g. a code and an expanded text) in which case each field is divided into values corresponding to the columns to be shown. The number of displayed columns is determined by the number of values in the first field.

 

return.colidentifies which column (from 1) of the selected item is to be returned as value.

 

index.colis the column number (from 1)  for shortcut entry. The list must be sorted into ascending order of this column. A value of zero implies that no shortcut is to be allowed.

 

 

The !PICKLIST() subroutine displays a box containing the items to from list. The user can use the up and down cursor keys to move through this list. If the list is longer than can be displayed, the subroutine will scroll the displayed items. The page up and down key can be used to move rapidly through the entries. The return key selects the current item, returning it in the value argument.

 

If index.col is non-zero, the user may enter the initial characters of an entry in the chosen column to position directly to the first entry starting with the entered prefix. The characters entered are displayed in the lower border of the box.

 

When used on a QMTerm or Windows QMConsole session or on a terminal that supports screen region save and restore, the area of the screen overwritten by the pick list box is automatically saved and restored. Programs using other terminal systems will need to arrange their own system to recover the screen.

 

 

Example

 

LIST = 'Blue':@FM:'Green':@FM:'Red'

CALL !PICKLIST(ITEM, LIST, 1, 1)

DISPLAY 'Selected item was ' : ITEM

 

 

See also:

!PICK()