# READLIST

Updated: 10/14/2021, 2:20:00 PM
Created: 10/14/2021, 2:20:00 PM
Last Updated By: mikes
Read Time: 1 minute(s)

Tags: lists handling record handling

# Description

READLIST allows the program to retrieve a previously stored list, into a variable. It takes the general form:

READLIST variable1 FROM expression {SETTING variable2} THEN|ELSE statement
1

Where:

  • variable1 is the variable into which the list will be read.
  • expression should evaluate to the name of a previously stored list to retrieve. If specified, variable2 will be set to the number of elements in the list.
  • If the statement succeeds in retrieving the list, then the statements associated with any THEN clause will be executed. If the statement fails to find the list, then the statements associated with any ELSE clause will be executed.

The READLIST statement is identical in function to the GETLIST statement.

An example of use is as:

READLIST MyList FROM "MyList" ELSE STOP
LOOP
* Loop until there are no more elements
WHILE READNEXT Key FROM MyList DO
......
REPEAT
1
2
3
4
5
6

See also: DELETELIST, FORMLIST, WRITELIST

Go back to jBASE BASIC

Go back to Programmers' Reference Guide