Chapter
10
I
BASIC Keywords
LINE INPUT
Statement
LINE INPUT[;]["prompt";] string variable
Accepts an entire line
(a
maximum
of
255
characters) from the
keyboard. LINE INPUT
is
a convenient way
to
input string data
without accidental entry
of
delimiters (commas, quotation marks,
etc.).
Prompt
is
a
string constant enclosed in quotation marks that
BASIC prints before waiting
for
input.
String variable
is
the variable
to
receive the input.
The only way
to
terminate the string input
is
to
press
I.
However, if LINE INPUT is immediately followed by a semicolon,
pressing
[ENTER]
does not echo
a
carriage return
to
the display.
Note:
You must place a space between LINE and
INPUT.
LINE INPUT
is
similar
to
INPUT, except:
0
BASIC does not display a
?
when waiting
for
input.
0
Only
1
variable can be assigned at
a
time.
0
Commas and quotation marks can be entered in the string
0
Leading blanks are not ignored.
input.
Examples
LINE INPUT
A$
waits for input
to
A$ without displaying a prompt.
LINE INPUT "LAST NAME, FIRST NAME?
'I;
N$
displays the message and waits for input.
202