INPUT
Function
:
6-2
Program
Commands
["Message
statement"
,] variable name ®
Character string
[,
["Message
statement",
] , V . bl ] *
ana
e
name
Character string
Assigns
input
from the keyboard
to
a variable.
Parameter:
Message:
Character string.
Variable
name
:
Numeric variable name
or
character variable name.
Explanation:
1)
Input
from the keyboard
is
assigned
to
a variable when the
~
key
is
pressed.
2)
If
there
is
a message, "?" will be displayed after the message and the com-
puter
will be in key
input
wait status.
3)
If
the message
is
omitted
,
"?"only
will be displayed.
4)
In
the
key
input
wait status
with
the
INPUT
statement,
the
message and
"?"
will be cleared wi
th
the
first key
input.
5) Error
(Error
2)
will occur
if
character string data
is
input
to
a numeric varia-
ble. Since
"?"
will be displayed again and a numeric value
input
will be
requested
when
the~
key is pressed, make a new input.
If~~
is
pressed,
program execution will be terminated.
6)
A numeric expression can be used
as
the
input
to
a numeric variable and
the
value
of
the
numeric expression will be assigned
to
the
numeric variable.
In this case, even one alphabetical
letter
will be regarded as a numeric
expression (variable).
7)
If
the
~key
only
is
pressed
without
inputting
the numeric value or
numeric expression,
the
value in the numeric variable will
not
change.
8)
If
the
~
key
only
is
pressed
without
inputting a character expression when
inputting
to
a character variable, null will be assigned
to
the
character
variable.
111