NAME

restore - modify read pointer for data statements

SYNOPSIS

restore [LineNum]
restore [LineLab]

DESCRIPTION

A restore statement modifies the read pointer associated with the data statements in a module so that the next read statement reads the first item from the data statement at or beyond the specified line number or label.  If no line number or label is specified, restore causes the read pointer to be reset to the beginning of the first data statement in the module. 

A module’s data area is private to the module.  A restore statement within one module does not effect the read pointer in other modules.  The possibility (and opportunity) exists to have data areas in each of several modules concurrently, each in the process of being read. 

EXAMPLE

The program
	10 data "A ", "ROSE ", "IS "
	20 read a$, b$, c$
	30 print a$; b$; c$;
	40 restore
	50 read d$, e$, f$
	60 print d$; e$; f$;
	70 restore
	80 read g$, h$
	90 print g$; h$
produces
	A ROSE IS A ROSE IS A ROSE
The strings "A ", "ROSE ", and "IS " are read in at line 20.  The restore statement in line 40 resets the read pointer to the beginning so that the values that are read in line 50 are again the strings "A ", "ROSE ", and "IS ".  Similarly, the restore statement in line 70 allows "A " and "ROSE " to be re-read in line 80. 

SEE ALSO

data, read

from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber