RESTORE
RESTORE
lline·numberl
(See
the
"File
Processing"
section
for
information
about
using
RESTORE
in
file
processing.)
This form of the
RESTORE
statement
tells your program which
DATA
statement
to use with the next
READ
statement.
When
RESTORE
is used with
no
line-number
and
the
next
READ
:statement is performed. values will be assigned beginning with the
first DATA statement in the program.
When
RESTORE
is followed by the line-number of a DATA
statement
and
the next
READ
statement
is
performed. values will
be assigned beginning with the first data-item in the DATA
statement
specified by the line·number.
If
the line-numberspecified in a
RESTORE
statement
is not a
DATA
statement
or
is
not a program line number. then the next
READ
statement performed will
start
at
the first DATA statement
whose line number
is
greater than the one specified.
If
there
is
no
DATA
statement with a line number greater
than
or
equal to the
one specified, then the next
READ
statement performed will cause
an out·of·data condition and a "DATA
ERROR"
message will be
displayed.
If
the line'number specified is greater than the highest
line number
in
the program. the program will stop running and the
message "DATA
ERROR
IN
xx" will be displayed.
11-64
Examples:
>NEW
>100
FOR
1=1
TO
2
>110
FOR
J=1
TO
4
>120
READ
A
>130 PRINT
A;
>140
NEXT
J
>150
RESTORE
180
>160
NEXT
1
>170
DATA
12,33,41,26,42,50
>180
DATA
10,20,30,40,50
>190
END
>RUN
12 33
41
26 10
20
30
40
**
DONE
**
>NEW
>100
fOR
1=1
TO
>110
READ
X
>120
RESTORE
>130
PRINT
Xi
>140
NEXT
1
>150
DATA
10,20,30
>160
END
>RUN
10
10
10
10 10
**
DONE
**
>NEW
>100
READ
A,S
>110
RESTORE
130
>120 PRINT
A;B
>130
READ
C,
D
>140
PRINT
C;D
>150
DATA
26.9,34.67
>160
END
>RUN
26.9
34.67
26.9
3/
•.
67
**
DONE
**
>110
R"STOR"
1/,5
>RUN
26.9
34.67
26.9
34.67
**
DONE
**
>110
RESTORE
155
>RIIN
26.9
34.67
*
DATA
ERROR
IN
130
User's Reference Guide