Purpose
Reads data from a sequential file.
INPUT# file number , variable name [ , variable name ]*
└────┬────┘
Numeric expression
Example
INPUT #1, A
Parameters
file number: Numeric expression truncated to an integer in the range of 1 ≦ filename < 2.
Explanation
- Reads data from the file specified by the file number.
- Data are input in the same format s data input using the INPUT statement
(see INPUT). Consequently, data are delimited using commas, quotation marks,
CR codes (0DH) or CR, LF codes (0Dʰ, 0Aʰ). Internal codes 00ʰ through 1Fʰ and 7Fʰ cannot be
input, and leading spaces (spaces preceding that data) are disregarded.
- This statement is valid for sequential files opened for input (
FOR INPUT
), and for
communication circuit (COM0:
) input/output files.
- Spaces can also be used as delimiters when data are read to numeric variables.
- An ST error is generated when data read exceeds 256 characters.
Execution continues using an
ON ERROR
statement begins from the 257th character.
Sample Program
10 OPEN "CAS0:TEST" FOR INPUT AS #1
20 INPUT #1,A$
30 PRINT A$;
40 IF EOF(1)=0 THEN 20
50 CLOSE: END
Reads and displays data in a sequential file on cassette tape until no more data remain.