EasyManua.ls Logo

Commodore VIC-20 - Page 366

Commodore VIC-20
404 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...
352
The
VIC
20
User
Guide
Note
that
you must input numeric
data
for a numeric variable, but you
can input numeric or string data for a string variable.
Caution:
If
the
RETURN
key
is
pressed in response to
an
INPUT
statement with no preceding
data
entry, program execution ceases and the
computer enters immediate mode. To restart execution type CONT in
response to the READY message.
INPUT#
The
INPUT
External statement (INPUT#) inputs one or more data
items from
an
external device identified via a logical file number.
Format:
INPUT#!fvar[,var, ... ,var]
The INPUT# statement inputs data from the selected external device
and assigns data items to variable(s)
var.
Data
items must agree in number
and kind with the INPUT# statement parameter list.
If
an
end-of-record
is
detected before all variables in the INPUT#
statement parameter list have received data, then an OUT
OF
DATA error
status
is
generated, but the program continues to execute.
INPUT# and
INPUT
statements execute identically, except that
INPUT# receives its input from a logical file. Also, INPUT# does not
display error messages; instead, it reports error statuses that the program
must interrogate and respond to.
Input data strings may not be longer than
80
characters
(79
characters
plus a carriage return) because the input buffer has a maximum capacity of
80
characters. Commas and carriage returns are treated as item separators
by the computer when processing the INPUT# statement; they are recog-
nized, but are not passed on to the program as data. INPUT#
is
valid in
program mode only.
Example:
100e
INPUT4U0,A
'46
INPUTi12,A$
Input the next data
item/rom
logical/ile
10.
A numeric
data item
is
expected; it
is
assigned
to
variable A
Input the
next
data
item/rom
logicalfile
12.
A string
data item
is
expected; it
is
assigned to variable
A$
Input the next two data
items/rom
logicalfile
5.
The
first data item
is
numeric;
it
is
assigned to numeric
variable
B.
The
second data item
is
a string;
it
is
assigned to string variable C$

Other manuals for Commodore VIC-20

Related product manuals