Chapter 8 Peripheral Devices 257
FIGURE
8·1. Tape position
READING
DATA
FILES
To
read the
data
back from the tape you will need to open a Datassette
file for reading. Add the following lines to the end
of
your Write
Data
program:
70
PRINT
"REWIND
TAPE"
80
PRINT
"WHEN
THE
TAPE
IS"
90
PRINT
"REWOUND,
?RESS
STOP"
100
PRINT
"ON
THE
DATASSETTE"
119
PR
I
NT
"THEN
H
IT
<RETURN>"
120
INPUT
C
130
OPEN
1,1,9,
"DATA
FII.E"
Lines
70
through
110
tell the operator to rewind the tape
and
to signal
the VIC when the rewinding
is
completed by pressing RETURN. Line
120
makes the computer wait until the tape has been rewound,
and
line
130
opens the
data
file for reading.