EasyManua.ls Logo

Commodore Plus 4 - Page 375

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The
Datassette
Tape
Recorder
363
The
VERIFY
command
is
also
useful
when
you
want
to
position
the
tape
beyond
the
last
file
recorded
on
it.
After
you
rewind
the
tape,
request
a
VERIFY
of
the
last
file
on
the
tape.
Of
course,
a
VERIFY
ERROR
is
reported
(unless
the
last
file
is
identical
to
the
program
in
memory).
But
the
tape
is
positioned
just
after
the
file,
ready
for
a
new
file
to
be
recorded.
Using
Data
Files
A
data
file
on
tape
consists
of
a
long
series
of
bytes
stored
on
the
tape.
It
can
be
identified
with
a
name
and
is
concluded
with
an
end-of-file
(or
end-of-tape)
mark.
The
purpose
for
which
the
file
is
being
accessed
must
be
given
in
the
secondary
address
sent
with
the
OPEN
statement:
OPEN
filenumber,1,
secondary,filename
The
filenumber
is
the
logical
file
number
to
be
associated
with
this
file.
It
is
for
reference
purposes
only
and
can
be
0-127
(128-255
will
send
a
linefeed
character
following
every
carriage
return).
The
secondary
address
specifies
the
use
of
the
file.
If
it
is
0
(or
omitted),
the
file
is
read.
If
it
is
1,
the
file
is
written
and
ended
with
an
end-of-file.
If
it
is
2,
the
file
is
written
and
ended
with
an
end-of-tape.
The
last
parameter
is
the
file
name
(a
string
expression
up
to
17
characters).
After
the
file
is
open,
output
may
be
directed
to
it
by
referring
to
its
logical
file
number
in
a
PRINT#
or
CMD
command.
Input
may
be
received
from
it
by
referring
to
its
logical
file
number
in
a
INPUT#
or
GET#
command.
When
the
input
to
or
output
from
a
file
is
complete,
the
file
must
be
closed
with
CLOSE
filenumber
where
filenumber
is
the
logical
file
number
of
the
file
to
close.
After
a
file
is
opened
for
writing,
each
byte
that
is
sent
to
it
is
stored
sequen
tially
on
the
tape.
The
format
of
the
bytes
written
to
a
tape
file
must
be
designed
with
the
method
of
retrieval
in
mind.
If
they
are
to
be
read
one
at
a
time
using
the
GET#
command,
any
format
is
all
right.
However,
if
they
are
to
be
read
using
the
INPUT#
command,
care
must
be
taken
to
store
comma
characters
between
values
and
carriage
return
characters
between
lines
of
input.
Example:
10
G0SUB130
SO
OPEN"l,l,l,"nATFIL"
30
PRIlTTCHR$(13)//WHATT0ST0RE//;:I]SrPUTA$
40
PRI1TT#1,A$
SO
CLOSE1
60
G0SUB130
70
PJEtINT"REWIlTD
THE
TAPE":WAIT64784,4,4
80
PRHSTT^WHEU
D01TE,
";:G0SUB130
90
0PEITl,l,0,"DATFIL"