EasyManua.ls Logo

Commodore 1581 - Chapter 5: Relative Data Files; Files, Records, and Fields; File Limits for Relative Files

Commodore 1581
138 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...
records
are
gone
too,
replaced
by
subdivisions
within
the
records,
called
fields.
Each
field
is
large
enough
to
hold
one
piece
of
informa
tion
about
one
record
in
the
file.
Thus, within
each
file
there
are
many
records,
and
within
each
record
there are
typically
many
fields.
A
relative
file
takes
care
of
organizing
the
records
for
you,
num
bering
them
from
1
to
the
highest
record
number,
by
ones,
but
the
fields
are
up
to
you
to
organize.
Each
record
will
be
of
the
same
size,
but
the
1581
won't
insist
that
they
all
be
divided
the
same
way.
On
the
other
hand,
they
normally
will
be
subdivided
the
same
way,
and
if
it
can
be
known
in
advance
exactly
where
each
field
starts
within
each
record,
there
are
even
fast
ways
to
access
a
desired
field
within
a
record
without
reading
through
the
other
fields.
As
all
of
this
implies,
access
speed
is
a
primary
reason
for
putting
information
into
a
relative
disk
file.
Some
well-written
relative
file
programs
are
able
to
find
and
read
the
record
of
one
desired
person
out
of a
thousand
in
under
15
seconds,
a
feat
no
sequential
file
program
could
match.
FILE
LIMITS
With
relative
files,
you
don't
have
to
worry
about
exactly
where
on
the
diskette's
surface
a
given
record
will
be
stored,
or
whether
it
will
fit
properly
within
the
current
disk
sector,
or
need
to
be
extended
onto
the
next
available
sector.
DOS
takes
care
of
all
that
for
you.
All
you
need
to
do
is
specify
how
long
each
record
is,
in
bytes,
and
how
many
records
you
will
need.
DOS
will
do
the
rest,
and
organize
things
in
such
a
way
that
it
can
quickly
find
any
record
in
the
file,
as
soon
as
it
is
given
the
record
number
(ordinal
position
within
the
file).
The
only
limit that
will
concern
you
is
that
each
record
must be
the
same
size,
and
the
record
length
you
choose
must
be
between
2
and
254
characters.
Naturally
the
entire
file
also
has
to
fit
on
your
diskette,
along
with
any
other
existing
file(s).
CREATING
A
RELATIVE
FILE
When
a
relative
file
is
to
be
used
for
the
first
time,
its
Open
statement
will
create
the
file;
after
that,
the
Open
statement
is
used
to
reopen
the
file
for
both
reading
and
writing.
FORMAT
STATEMENT
TO
OPEN
A
RELATIVE
FILE:
BASIC
7.0:
DOPEN
#
file
#,
"file
name",
L record
length
[JDdrive
#]
[,Udevice
#]
BASIC
2.0:
OPEN
file
#,
device
#,
channel
#,
"drive
#:
file
name,
L,"
+
CHR$
(record
length)
54

Table of Contents

Other manuals for Commodore 1581

Related product manuals