qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
INPUT$ Function
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Returns a string of characters read from a specified file.
 
INPUT$(n[,[#]filenumber%])
 
    ■ n              The number of characters (bytes) to read.
    ■ filenumber%    The number of an open file. If filenumber% is
                     omitted, INPUT$ reads from the keyboard.
 
Example:
    OPEN "TEST.DAT" FOR OUTPUT AS #1
    PRINT #1, "The text"
    CLOSE
    OPEN "TEST.DAT" FOR INPUT AS #1
    PRINT INPUT$(3, 1)        'Print first 3 characters.
    CLOSE
 
See Also    INPUT, LINE INPUT