READLIST |
![]() ![]() ![]() |
The READLIST statement reads a select list into a dynamic array.
Format
READLIST var {FROM list.no} {THEN statement(s)} {ELSE statement(s)}
where
At least one of the THEN and ELSE clauses must be present.
The specified select list is read into var. If the list had already been partially processed by READNEXT statements, only the remaining unprocessed items are stored in var.
The select list is empty after the READLIST statement is completed.
The THEN clause is executed if var contains one or more items. Items are separated by field marks. If compatibility with other software is required, it is suggested that programs should be written to accept either field marks or item marks (or a mix) as list separators.
The ELSE clause is executed if the select list was not active or if no items remained to be processed. In this case var will be set to a null string.
Example
READLIST S FROM 2 THEN WRITE S TO LISTS, "UNPROCESSED" END
This program fragment retrieves the remaining items in select list 2 and, if there are any, writes them to a record UNPROCESSED in file LISTS. |