input$ - read characters from the keyboard or a file


v$ = input$(NumExpr[, [#]FileNum])


Input$ 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 open 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)
	    print v$;
	    goto 20
	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 input$, terminal input is line-oriented.  If characters are already available in the keyboard buffer when input$ is executed, those characters are first returned.  If more characters are requested than are available in the keyboard buffer, input$ will not return until a complete line of input is typed.  After the line of input has been entered, the call to input$ will return.  After obtaining the requested number of characters from the input, input$ leaves unread any subsequent characters, including the terminating newline character.  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 random access. 

An "Input past end" error occurs when an attempt is made to read beyond the end of the file. 

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber