input$ - read characters from the keyboard or a file
reads a specified number of characters from a specified file.
NumExpr is the number of characters to be read from the file.
FileNum is the file number used in the
statement for the file to be read.
If FileNum is omitted, the standard input is used.
If the characters are read from a keyboard (rather than a disk file),
the characters are not echoed back, i.e., they are not displayed
on the screen.
This program lists the contents of a sequential file.
open "data" for input as #2
20 if eof(2) then 100
v$ = input$(1, 2)
100 close #2
input, input #, inkey$
If the environment variable BASECHO is set to a non-null value
when a Basmark QuickBASIC program begins executing,
the BASIC input/output facility operates differently in order
to support half-duplex terminals such as the IBM 3278.
In this modified behavior of the input/output facility, the terminal
modes are not altered, so that the usual erase and kill processing
and echoing of terminal input are performed.
In the specific case of
terminal input is line-oriented.
If characters are already available in the keyboard buffer when
those characters are first returned.
If more characters are requested than are available in the keyboard buffer,
will not return until a complete line of input is typed.
After the line of input has been entered,
the call to
After obtaining the requested number of characters from the input,
leaves unread any subsequent characters, including the terminating
These characters remain in the keyboard buffer and are available as input
to subsequent input statements.
A "Bad file number" error occurs if FileNum is less than 0 or greater
than the maximum number of files permitted or if FileNum is not open.
An "Illegal function call" error occurs if FileNum is open for
An "Input past end" error occurs when an attempt is made to
read beyond the end of the file.
The Basmark QuickBASIC Programmerís Manual