5.4.5.6 Line Input Statement

A <line-input-statement> reads in one line of data from the file underlying <marked-file-number>.

 line-input-statement = "Line"  "Input" marked-file-number "," variable-name 
  
 variable-name = variable-expression 

Static Semantics.

§ The <variable-expression> of a <variable-name> MUST be classified as a variable.

§ The semantics of <marked-file-number> in this context are those of a <file-number> element that consisted of that same <marked-file-number> element.

§ The declared type of a <variable-name> MUST be String or Variant.

Runtime Semantics.

§ An error (number 52, "Bad file name or number") is raised if the file number value (section 5.4.5.1.1) of <file-number> is not a currently-open (section 5.4.5.1) file number (section 5.4.5).

§ The sequence of bytes starting at the current file-pointer-position in the file identified by the file number value and continuing through the last byte of the current line (section 5.4.5) (but not including the line termination sequence (section 5.4.5)) is converted in an implementation dependent manner to a String data value.

§ If the end of file is reach before finding a line termination sequence, the data value is the String data value converted from the byte sequence up to the end of the file.

§ If the file is empty or there are no characters after file-pointer-position, then runtime error 62 ("Input past end of file") is raised.

§ The new file-pointer-position is equal to the position of the first character after the end of the line termination sequence. If the end-of-file was reached the file-pointer-position is set to the position immediately following the last character in the file.

§ The String data value is Let-assigned into <variable-name>.