EasyManua.ls Logo

Commodore 1581 - Commas and Colons in File Handling

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...
INPUT#
statement,
but
may
also
have
been
caused
by
errors
in
a
PRINT#
statement
when
the
file
was
written.
"String
Too
Long"
Error
A
BASIC
string
may
be
up
to
255
characters
long,
although
the
longest
string
you
can
enter
via
a
single
Input
statement
is
just
under
two
lines
of
text.
This
lower
limitation
is
due
to
the
size
of
the
input
buffer
in
Commodore's
serial
bus
computers.
The
same
limit
applies
to
INPUT#
statements.
If
a
single
data
element
(string
or
number)
being
read
from
a
disk
file
into
an
INPUT#
statement
contains
more
than
88
(BASIC
2)
and
160
(BASIC
7)
characters,
BASIC
will
halt
with
a
"STRING
TOO
LONG
ERROR."
"File
Data" Error
The
other
error
message
"FILE
DATA
ERROR"
is
caused
by
at
tempting
to
read
a
non-numeric
character
into
a
numeric
variable.
To
a
computer,
a
number
is
the
characters
0
through
9,
the
"
+
"
and
"
-
"
signs,
the
decimal
point
(.),
the
SPACE
character,
and
the
letter
"E"
used
in
scientific
notation.
If
any
other
character
appears
in
an
IN-
PUT#
to
a
numeric
variable,
"FILE
DATA
ERROR"
will
be
displayed
and
die
program
will
halt.
The
usual
causes
of
this
error
are
a
mis
match
between
the
order
in
which
variables
are
written
to
and
read
from
a
file,
a
missing
carriage
return
within
a
PRINT#
statement
that
writes
more
than
one
data
item,
or
a
data
item
that
includes
either
a
comma
or
a
colon
without
a
preceding
quotation
mark.
Once
a
file
data
error
has
occurred,
you
should
correct
it
by
reading
the
data
item
into
a
string
variable,
and
converting
it
back
to
a
number
with
the
BASIC
VAL()
statement
after
removing
non-numeric
characters
with
the
string
functions
described
in
your
computer
user's
manual.
Commas
(,)
and
Colons
(:)
As
suggested
before,
commas
and
colons
can
cause
trouble
in
a
file,
because
they
delimit
(end)
the
data
element
in
which
they
appear
and
cause
any
remaining
characters
in
the
data
element
to
be
read
into
the
next
INPUT#
variable.
They
have
the
same
effect
in
an
INPUT
statement,
causing
the
common
"EXTRA
IGNORED"
error
message.
However,
sometimes
you
really
need
a
comma
or
colon
within
a
data
element,
such
as
a
name
written
as
"Last,
First."
The
cure
is
to
precede
such
data
elements
with
a
quotation
mark.
After
a
quotation
mark,
in
either
an
INPUT
or
INPUT#
statement,
all
other
characters
except
a
carriage
return
or
another
quotation
mark
are
accepted
as
part
of
the
current
data
element.
46

Table of Contents

Other manuals for Commodore 1581

Related product manuals