EasyManua.ls Logo

Commodore 1541-II - Adding to a Sequential File

Commodore 1541-II
104 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...
Of
course,
this
erases
all
our
old
phone
numbers,
so
make
sure
that
any
information
that
may
be
deleted
is
of
no
importance.
After
writing
our
phone
file,
we
remove
our
diskette
and
turn
off
the
system.
Later,
to
recall
the
data
in
the
file,
we
would
reopen
it
with
something
like
OPEN
8,8,8,"0:PHONES,S,R"
It
doesn't
matter
whether
the
file
and
channel
numbers
match
the
ones
we
used
before,
but
the
file
name
does
have
to
match.
However,
it
is
possible
to
use
an
abbreviation
form
of
the
file
name,
if
there
are
no
other
files
that
would
have
the
same
abbreviation:
OPEN
10,8,6,"0:PH*,S,R"
If
we
have
too
many
phone
numbers,
they
might
not
fit
in
one
file.
In
that
case,
we
might
use
several
similar
file
names,
and
let
a
program
choose
the
correct
file.
100
INPUT
"WHICH
PHONE
FILE
(1-3)";PH
110
IF
PHO1
AND
PHO2
AND
PH<>3
THEN
100
120
OPEN
4,8,2,"PHONE"
+
STR$(PH)
+
",S,R"
You
can
omit
the
drive
number
on
an
Open
command
to
read a
file.
Doing
so
allows
those
with
dual
drives
to
search
both
diskettes
for
the
file.
Note:
Basic
2
and
Basic
3.5
use
the
same
file
handling
commands
and
the
same
direct
access
commands
(chapters
7-8).
Unless
otherwise
noted,
you
may
use
the
same
commands
for
both
throughout
the
remainder
of
this
book.
ADDING
TO
A
SEQUENTIAL
FILE
On
Commodore's
PET
and
CBM
models,
an
Append
command
allows
you
to
reopen
an
existing
sequential
file
and
add
more
information
to
the
end
of
it.
The
same
thing
can
be
done
another
way
on
the
1541.
In
place
of
the
"type"
and
"direction"
parameters
in
your
Open
statement,
substitute
",A"
for
Append.
This
will
reopen
your
file,
and
position
the
disk
head
at
the
end
of
the
existing
data
in
your
file,
ready
to
add
to
it.
FORMAT
FOR
THE
APPEND
OPTION
OPEN
file
#,device
#,channel
#,"drive
#:file
name,A"
where,
everything
is
as
on
the
previous
page
except
for the
ending
"A"
replacing
the
"type"
and
"direction"
parameters.
45

Table of Contents

Related product manuals