back to Command Reference
[FX-870P/VX-4]
Purpose
Read one line of character string data from a sequential file.
LINE INPUT # file_number, character_variable
Example
LINE INPUT # 1, A$
Parameters
- file_number: Numeric expression specifying the file number (opened with
OPEN).
- character_variable: String variable to receive the data.
Explanation
- Reads one line of character string data from the sequential file specified
by the file number.
- Data is read from the current file position until the end of the line is
reached.
- The file must be opened for input with the OPEN statement before
using this command.
- Unlike INPUT#, commas and quotation marks within the data
are treated as ordinary characters and included in the string.
See
Sample Program
10 OPEN "CAS0:DATA" FOR INPUT AS #1
20 LINE INPUT # 1, A$
30 PRINT A$
40 CLOSE
Reads one line from the sequential file “DATA” and displays it.