If vou forget ta close a file prior ta the program end, vou may ruin your file.
When
a file
is
opened for write, the data
is
stored in a buffer
area
prior ta being
transferred ta the tape. If the file
is
not closed, the data
will
probably NOT
be
trans1'erred ta the tape. If the data
is
transferred under these conditions, other
problems can result. If the file
is
written
over a previously recorded tape, and the
file
is
not closed, no end-of-file marker
is
written. This problem
will
not present it-
self until the file
is
subsequently read,
when
either a
READ
ERROR
will
be
gener-
ated or the tape
will
be
read past where the end-of-file should
be,
and the remain-
ing
"garbage"
on the tape
will
be
read.
CLOSE
may
be
executed in either immediate or program mode.
After
writing
ta
a file, if no tape control key
is
depressed when a
CLOSE
is
issued, the
PET
dis-
plays the
following
message:
PRESS
PLAY &
RECORD
ON
TAPE
#l-Press
keys
OK
• Tape begins moving ta
write
tape buffer.
No tape control keys need ta
be
down
for a
CLOSE
after a
READ
commando
Examples:
CMD
CLOSE
1
CLOSE
14
A=14
CLOSE
A
Close logical file
1.
Close logical file 14.
Same
as
above.
The CMD statement directs the PET-user screen dialogue ta another
output
device.
Format:
CMD file
where:
file
is
the logical file number that was given
when
the file was opened.
After
a CMD
statement
output
for subsequent PRINT and LIST commands
is
directed ta
the"
commanded"
device rather than ta the screen.
CMD may
be
executed in immediate or program mode.
124