EasyManua.ls Logo

Commodore 1581 - Page 48

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...
NOTE
In
the
last
chapter
you
learned
how
to
check
for
disk
errors
after
disk
commands
in
a
program.
It
is
equally
important
to
check
for
disk
errors
after
using
file-handling
statements.
Failure
to
detect
a disk
error
before
using
an
other
file-handling
statement
could
cause
loss
of
data,
and
failure
of
the
BASIC
program.
The
easiest
way
to
check
the disk
is
to
follow
all
file-
handling
statements
with
a
GOSUB
statement
to
an
error
check
subroutine.
EXAMPLE:
BASIC
7.0
840
DOPEN#4,"DEGREE
DAY
DATA",D0,U8,W
850
GOSUB
59990:
REM
CHECK
FOR
DISK
ERRORS
BASIC
2.0
840
OPEN
4,8,4,"0:DEGREE
DAY
DATA,S,W"
850
GOSUB
59990:REM
CHECK
FOR
DISK
ERRORS
FORMAT
FOR THE
DISK
OPEN
STATEMENT
FOR
SEQUENTIAL
FILES:
BASIC
7.0
DOPEN#file#,
"file
name"
[,Ddrive#]
[,Udevice#]
[,W]
BASIC
2.0
OPEN
file
#,
device
#,
channel
#,"drive
#:file
name,file
type,-
direction"
where:
"file
#"
is
an
integer
(whole
number)
between
1
and
255.
Do
not
open
a
disk
file
with
a
file
number
greater
than
127
it
will
cause
severe
problems.
After
the
file
is
open,
all
other
file
commands
will
refer
to
it
by
the
number
given
here.
Only
one
file
can
use
any
given
file
number
at
a
time.
"device
#"
is
the
number,
or
primary
address,
of
the
device
to
be
used.
This
number
is
an
integer
in
the
range
8-11,
and
is
normally
8
on
the
1581.
"channel
#"
is
a
secondary
address,
giving
further
instructions
to
the
selected
device
about
how
further
commands
are
to
be
obeyed.
In
disk
files,
the
channel
number
selects
a
particular
channel
along
which
39

Table of Contents

Other manuals for Commodore 1581

Related product manuals