Line Input# Statement

Reads a line from a sequential file into a variable.

语法:

Line Input Statement diagram


Line Input #fileNum, variable

参数:

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.

使用「Line Input#」语句,可以从打开的文件中读取字符串并将它写入一个变量。逐行读取字符串变量的过程在遇到第一个回车 (Asc=13) 或换行 (Asc=10) 时停止。得到的字符串中不包括行尾标记。

示例:

请支持我们!