WRITELIST

WRITELIST

Top  Previous  Next

 

The WRITELIST statement writes a dynamic array to the $SAVEDLISTS file.

 

 

Format

 

WRITELIST ids TO list.name

 

where

 

idsevaluates to the data to be written. This should be a field mark delimited dynamic array.

 

list.nameis the name of the item to be written in the $SAVEDLISTS file.

 

The keyword ON may be used in place of TO.

 

 

The WRITELIST statement allows a program to form a saved select list from a field mark delimited dynamic array. It is equivalent to opening the $SAVEDLISTS file and writing the ids variable to a record named list.name. The file is opened in non-transactional mode such that the write occurs immediately, not on transaction commit.

 

It is important that the ids list does not contain any mark characters other than the field marks between each item.

 

 

Example

 

READ ITEMS FROM STOCK.FILE, STORE.CODE THEN

  WRITELIST ITEMS TO 'STORE.LIST'

END

 

The above program fragment reads a record from the file open as STOCK.FILE and then writes this to $SAVEDLISTS as "STORE.LIST".

 

 

See also:

  GETLIST, SAVELIST