!PICK()

!PICK()

Top  Previous  Next

 

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

 

 

Format

 

CALL !PICK(item, top.line, item.list, title, pos)

 

where

 

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

 

top.lineis the line number of the topmost display line to be used. The pick list display uses from this line to the bottom of the screen.

 

item.listis a field mark delimited list of items to display. Long items will be truncated to fit a single line.

 

titleis a short text description of the items being processed. This is displayed alongside the item count at the bottom of the screen. This may be a null string to omit the title.

 

posenables programs to return to a pick list at the position of a previously displayed item. On initial entry, this should be zero or a null string. If a variable name is used for pos, this variable will be updated to contain position information related to the list. A subsequent call to !PICK() using this updated value will display the screen as it was when the previous item was selected. Programs should not make any assumption about the format of this variable as it may change between QM releases.

 

 

The !PICK() subroutine displays a list of items as specified in list. The user can move through this list using the following keys:

 

Down one line:

Cursor down

D

Ctrl-N

 

Up one line:

Cursor up

U

Ctrl-P

Ctrl-Z

Down page:

Page down

N

Ctrl-V

 

Up page:

Page up

P

Esc-V

 

Top:

Home

T

Esc-<

 

Bottom:

End

B

Esc->

 

 

 

Example

 

OPEN "ACCOUNTS" TO ACC.F ELSE STOP "Cannot open ACCOUNTS file"

SSELECT ACC.F

READLIST LIST ELSE NULL

CALL !PICK(ITEM, 0, LIST, "Accounts", POS)

IF ITEM # "" THEN

  READ ACC.REC FROM ACC.F, ITEM THEN

     ...processing...

  END

END

 

The above example shows a list of records in the ACCOUNTS file and processes the selected record.

 

 

See also:

!PICKLIST()