EasyManua.ls Logo

Commodore 1581 - Reading File Data: Using INPUT#

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...
FORMAT
FOR
THE
CLOSE
STATEMENT
BASIC
7.0:
DCLOSE#file#
[,Udevice#]
BASIC
2.0:
CLOSE
file
#
where
"file
#"
is
the
same
file
number
given
in
the
desired
file's
cur
rent
OPEN
statement.
EXAMPLES:
To
close
the
data
file
#5
used
as
an
example
on
the
previous
page,
use:
BASIC
7.0:
DCLOSE#5
BASIC
2.0:
CLOSE
5
In
BASIC
7.0,
when
the
DCLOSE
statement
is
used
alone
(no#
or
file#
parameters),
it
closes
all
disk
files
at
once.
With
a
bit
of
planning,
the
same
can
be done
via
a
program
loop.
Since there
is
no
harm
in
closing
a
file
that
wasn't
open,
close
every
file
you
even
think
might
be
open
before
ending
a
program.
If
you
always
gave
your
files
numbers
between
1
and
5,
you
could
close
them
all
with
9950
FOR
1
=
1
TO
5
9960
CLOSE
I
9970
GOSUB
59990:REM
CHECK
FOR
DISK
ERRORS
9980
NEXT
I
assuming
your
program
includes
an
error
check
subroutine
like
the
one
in
the
last
chapter.
READING
FILE
DATA:
USING
INPUT#
Once
information
has
been
written
properly
to
a
diskette
file,
it
may
be
read
back
into
the
computer
with
an
INPUT#
statement.
Just
as
the
PRINT#
statement
is
much
like
the
PRINT
statement,
INPUT#
is
nearly
identical
to
INPUT,
except
that
the
list
of
items
following
the
command
word
comes
from
a
particular
file
instead
of
the
keyboard.
Both
statements
are
subject
to
the
same
limitations—halting
input
after
a
comma
or
colon,
not
accepting
data
items
too
large
to
fit
in
BASIC'S
input
buffer,
and
not
accepting
non-numeric
data
into
a
numeric
vari
able.
44

Table of Contents

Other manuals for Commodore 1581

Related product manuals