EasyManua.ls Logo

Sharp MZ-800 - Page 110

Sharp MZ-800
221 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
#
Format
INPUT
#
<logical
number>,
<variable>
[,
<variable>]
...
Abbreviated
Format
Explanation
Example
See
also
l.#
The
INPUT
#
statement
sequentially
reads
data
items
from
the
file
opened
for
in-
put
with
the
ROPEN
#
statement
and
assigns
them
to
program
variables.
<variable>
may
be
an
array
element.
<logical
number
>
is
the
same
number
used
as
when
the
file
was
first
opened
for
input
by
the
ROPEN
#
statement.
As
with
the
READ
~
DATA
statement
pair,
an
error
may
be
generated
if
data
and
variable
types
disagree.
The
end
of
file
can
be
tested
by
using
the
EOF
#
func-
tion
if
the
specified
file
is
on
the
RAM
file
board.
10
ROPEN
#2,
““DATA2"
20
INPUT
#2,
A,
B,
C
30
PRINT
A,
B,
C
40
CLOSE
#2
50
END
This
sample
program
reads
numeric
data
from
the
file
opened
for
input
under
logi-
cal
number
2
and
assigns
the
data
to
numeric
variables
A,
B,
and
C.
ROPEN#,
CLOSE
#,
EOF
#
EOF(#)
Format
Explanation
Example
See
also
EOF(#
<logical
number>)
Abbreviated
Format
EO.
#
The
EOF(
#)
function
is
used
to
find
the
end
of
a
file.
This
function
signals
an
end-
of-file
condition
when
all
data
in
the
file
has
been
read.
The
value
1
(true)
is
returned
after
the
end
of
the
file
is
encountered.
EOF(#)
is
invalid
when
reading
data
from
CMT.
The
EOF(#)
function
is
generally
used
with
the
IF
statement
and
placed
after
an
INPUT
#
statement.
10
ROPEN
#3,
“DATA”
20
INPUT
#3,
A
30
IF
EOF(
#3)
THEN
END
40
PRINT
A
50
GOTO
20
The
above
program
reads
data
items
sequentially
from
the
file
named
““DATA”’
and
displays
them
on
the
screen
until
the
end
of
the
file
is
encountered.
INPUT
#
6-53

Other manuals for Sharp MZ-800

Related product manuals