<<

Contents

Search

>>

 

LINE INPUT

 

 

Instruction

 

 

Syntax:

LINE INPUT <File Number>,<String Variable> ON ERROR ... END

 

<File Number>

= <NUM-EXPRESSION>

<String Variable>

= <STRING-VARIABLE>

 

 

Meaning:

Reads a line from a sequential file.

 

In the case of an error the block ON ERROR ... END is executed.

 

Note: Before every instruction LINE INPUT the end of file must be tested with IF EOF(...) or WHILE NOT EOF (...), because at the end of file only the empty string without error report is returned.

 

Parameter:

File Number

Number of sequential file

String Variable

Contains the read line

 

Sample:

OPEN INPUT,1,"TEST.DAT" ON ERROR … Error … END

WHILE NOT EOF(1)

DO LINE INPUT 1,LINE$ ON ERROR … Error … END

   …

ENDDO

 

See also:

EOF

INPUT

INPUT$

OPEN

OUTPUT

CLOSE 

Error numbers