EasyManua.ls Logo

Commodore Plus 4 - Page 367

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
Disk
Drive
388
Close
Files
can
be
closed
individually
with
the
CLOSE
($FFC3)
routine:
1.
Load
.A
with
the
logical
file
number
of
the
file
to
be
closed.
Call
CLOSE
($FFC3).
2.
Check
for
errors
by
examining
the
carry
bit,
status
byte,
and
disk
error
channel.
Generally,
checking
the
carry
bit
and
disk
error
channel
is
sufficient.
All
the
files
in
use
can
be
closed
and
the
input
and
output
channels
reset
to
their
default
devices
by
calling
CLALL
($FFE7).
Print
To
send
information
into
a
file,
it
must
have
been
opened
with
a
mode
of
write.
The
following
outlines
the
operations
required:
1.
Load
.X
with
the
logical
file
number
of
the
output
file.
Designate
it
as
the
output
channel
by
calling
CHOUT
($FFC9).
2.
Check
for
errors.
3.
Send
the
data
to
the
channel
with
BSOUT
($FFD2).
4.
When
all
data
has
been
sent,
return
the
input
and
output
channels
to
default
(keyboard
and
screen)
by
calling
CLRCH
($FFCC)
and
close
the
file.
Or
call
CLALL
($FFE7)
to
close
all
files
and
reset
the
input
and
output
channels.
Get
To
receive
information
from
a
file,
it
must
have
been
opened
with
a
mode
of
read
(no
mode
defaults
to
read).
The
following
outlines
the
operations
required:
1.
Load
.X
with
the
logical
file
number
of
the
input
file.
Designate
it
as
the
input
channel
by
calling
CHKIN
($FFC6).
2.
Check
for
errors.
3.
Receive
the
data
from
the
channel
with
BASIN
($FFCF).
4.
When
all
data
has
been
received,
return
the
input
and
output
channels
to
default
(keyboard
and
screen)
by
calling
CLRCH
($FFCC)
and
close
the
file.
Or
call
CLALL
($FFE7)
to
close
all
files
and
reset
the
input
and
output
channels.
Example:
This
example
opens
a
new
file
called
D
ATFIL
and
writes
data
accepted
from
the
keyboard
to
it.
It
then
closes
the
file,
reopens
it
for
reading,
and
retrieves
the
data,