EasyManua.ls Logo

Commodore 1541-II - Chapter 5: Sequential Data Files

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...
CHAPTER
5
SEQUENTIAL
DATA
FILES
THE
CONCEPT
OF
FILES
A
file
on
a
diskette
is
just
like
a
file
cabinet
in
your
office—an
organized
place
to
put
things.
Nearly
everything
you
put
on
a
diskette
goes
in
one
kind
of
file
or
another.
So
far
all
we've
used
are
program
files,
but
there
are
others,
as
we
have
mentioned.
In
this
chapter
we
will
learn
about
sequential
data
files.
As
we
just
suggested,
the
primary
purpose
of
a
data
file
is
to
store
the
contents
of
program
variables,
so
they
won't
be
lost
when
the
program
ends.
A
sequential
data
file
is
one
in
which
the
contents
of
the
variables
are
stored
"in
sequence,"
one
right
after
another,
just
as
each
link
in
a
chain
follows
the
previous
link.
You
may
already
be
familiar
with
sequential
files
from
using
a
DATASSETTE™,
because
sequential
files
on
diskette
are
just
like
the
data
files
used
on
cassettes.
Whether
on
cassette
or
diskette,
sequential
files
must
be
read
from
beginning
to
end,
without
skipping
around
in
the
middle.
When
sequential
files
are created,
information
(data)
is
transferred
byte
by
byte,
through
a
buffer,
onto
the
magnetic
media.
Once
in
the
disk
drive,
program
files,
sequential
data
files,
and
user
files
all
work
sequentially.
Even
the
directory
acts
like
a
sequential
file.
To
use
sequential
files
properly,
we
will
learn
some
more
Basic
words
in
the
next
few
pages.
Then
we'll
put
them
together
in
a
simple
but
useful
program.
Note:
Besides
sequential
data
files,
two
other
file
types
are
recorded
sequentially
on
a
diskette,
and
may
be
considered
varying
forms
of
sequential
files.
They
are
program
files,
and
user
files.
When
you
save
a
program
on
a
diskette,
it
is
saved
in
order
from
beginning
to
end,
just
like
the
information
in
a
sequential
data
file.
The
main
difference
is
in
the
commands
you
use
to
access
it.
User
files
are
even
more
similar
to
sequential
data
files—differing,
for
most
purposes,
in
name
only.
User
files
are
almost
never
used,
but
like
program
files,
they
could
be
treated
as
though
they
were
sequential
data
files
and
are
accessed
with
the
same
commands.
For
the
advanced
user,
the
similarity
of
the
various
file
types
offers
the
possibility
of
such
advanced
tricks
as
reading a
program
file
into
the
computer
a
byte
(character)
at
a
time
and
rewriting
it
to
the
diskette
in
a
modified
form.
The
idea
of
using
one
program
to
write
another
is
powerful,
and
available
on
the
Commodore
disk
drives.
OPENING
A
FILE
One
of
the
most
powerful
tools
in
Commodore
Basic
is
the
Open
statement.
With
it,
you
may
send
almost
any
data
almost
anywhere,
much
like
a
telephone
switchboard
that
can
connect
any
caller
to
any
destination.
As
you
might
expect,
a
command
that
can
do
this
much
is
fairly
complex.
You
have
already
used
Open
statements
regularly
in
some
of
your
diskette
housekeeping
commands.
42

Table of Contents

Related product manuals