Restore

Selects the Data statements to be read with Read

Syntax

Restore label

Description

Normally a Read command reads from the next unread Data statement. You can change this behaviour by using the Restore command to manually select the data statements to be read to be the first ones following a given label.

Example:
int    a,b
read a,b
print a,b
read a,b
print a,b
restore beginning
read a,b
print a,b

beginning:
data 1,2
data 3,4

This example would print the numbers 1 2 3 4 and then move the read position to the label 'beginning' and read and print the numbers 1 and 2 again.

See also Read and Data.

Table of contents