EasyManua.ls Logo

Commodore 1581 - Page 51

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...
where
"file
#"
is
the
same
file
number
given
in
the
desired
file's
current
OPEN
statement.
During
any
given
access
of a
particular
file,
the
file
number
must
remain
constant
because
it
serves
as
a
shorthand
way
of
relating
all
other
file-handling
commands
back
to
the
correct
OPEN
statement.
Given
a
file
number,
the
computer
can
look
up
everything
else
about
a
file
that
matters.
The
"data
list"
is
the
same
as
for
a
PRINT
statement
-
a
list
of
constants,
variables
and/or
expressions,
including
numbers,
strings
or
both.
However,
it's
better
if
each
PRINT#
statement
to
disk
include
only
one
data
item.
If
you
wish
to
include
more
items,
they
should
be
separated
by
a
carriage
return
character,
not
a
comma.
Semicolons
are
permitted,
but
not
recorded
in
the
file,
and
do
not
result
in
any
added
spaces
in
the
file.
Use
them
to
separate
items
in
the
list
that
might
otherwise
be
confused,
such
as
a
string
variable
immediately
following
a
numeric
variable.
-NOTE
Do
not
leave
a
space
between
PRINT
and
#,
and
do
not
abbreviate
the
command
as
?#.
The
correct
abbreviation
for
PRINT#
is
pR.
EXAMPLES:
To
record
a
few
grades
for
John
Paul
Jones,
using
a
sequential
disk
file
#1
previously
opened
for
writing,
use:
200
FOR
CLASS
=
1
TO
COURSES
210
PRINT#1,GRADE$(CLASS)
220
GOSUB
59990:REM
CHECK
FOR
DISK
ERRORS
320
NEXT
CLASS
assuming
your
program
includes
an
error
check
subroutine
like
the
one
in
the
last
chapter.
In
using
PRINT#,
there
is
an
exception
to
the
requirement
to
check
for
disk
errors
after
every
file-handling
statement.
When
using
PRINT#,
a
single
check
after
an
entire
set
of
data
has
been
written
will
still
detect
the
error,
so
long
as
the
check
is
made
before
any
other
file-handling
statement
or
disk
command
is
used.
You
may
be
familiar
with
PRINT
statements
in
which
several
items
follow
each
other:
400
PRINT
NAME$,STREET$,CITY$
42

Table of Contents

Other manuals for Commodore 1581

Related product manuals