Chapter
10
I
BASIC
Ke.ywords
INPUT$
Statement
INPUT$
(
nu
m
ber
[
,
[
#
]
buffer])
Accepts a string
of
characters from either the keyboard or
a
se-
quential access file.
Number
is the number
of
characters
to
be input. It must be a
value in the range
1
to
255.
Buffer
is
a
buffer that accesses
a
sequential input file. If you in-
clude
buffer,
BASIC inputs the string from sequential access file.
If you omit
buffer,
BASIC inputs the string from the keyboard.
The number sign
(#)
is optional. It is provided for compatibility
with other BASICs.
When inputting the string from the keyboard, BASIC waits until
the user enters the number
of
characters specified by
number.
You do not need to press
[m]
to
signify end-of-line. The charac-
ter(s) you type are not displayed on the screen. Any character,
except
F][EiEK],
is accepted
for
input.
When inputting from a sequential file, BASIC inputs the num-
ber
of
bytes specified by
number
from the file assigned
to
buffer.
Examples
A$
=
INPUT$(S)
assigns a string
of
5
keyboard characters
to
A$.
Program execu-
tion halts until
5
characters are typed at the keyboard.
A$
=
INPUT$C11,3)
assigns
a
string of
11
characters to A$. The characters are read
from the file associated with Buffer
3.
183