WRITELIST Statement

Writes a string to POINTER-FILE as a saved list.

Syntax

WRITELIST string-exp [ON || TO] list-name

Syntax Elements

string-exp is a field of characters expressed as a variable name or a literal enclosed in quotes that contains the list of item-ids to be saved.

list-name is the name with which the list will be saved in POINTER-FILE.

Comments

Each attribute in the string is used as an item-id when the list is later used.

Lists produced by a WRITELIST statement can be used later in the same program by executing a GETLIST or READLIST statement.

Example 1

EQU AM TO CHAR(254)
READLIST LIST1 FROM '15-40' ELSE...
READLIST LIST2 FROM 'OVER.40' ELSE...
LIST3 = LIST1:AM:LIST2
X = 'OVER.15'
WRITELIST LIST3 ON X
PRINT LIST3

Reads LIST1 and LIST2 and combines them into one list (LIST3). LIST3 is then written to POINTER-FILE as a saved list, and its contents are displayed on the terminal.

Example 2

A = "ITEM1":AM:"ITEM2":AM:"ITEM3"
WRITELIST A ON "ITEMS"
:GET-LIST ITEMS
3 ITEMS SELECTED
>

Writes contents of A to POINTER-FILE called ITEMS. The list can later be retrieved with a GET-LIST command issued at TCL or with a GETLIST or READLIST statement executed in the same program.

Go to top button