Line Input# Statement

Reads a line from a sequential file into a variable.

Syntaks:

Line Input Statement diagram


Line Input #fileNum, variable

Parametre:

fileNum: Number of the file that contains the data that you want to read. The file must have been opened in advance with the Open statement using the key word INPUT.

variable: The name of the variable that stores the result.

With the Line Input# statement, you can read strings from an open file into a variable. String variables are read line-by-line up to the first carriage return (Asc=13) or linefeed (Asc=10). Line end marks are not included in the resulting string.

Eksempel:

Supporter oss!