LINE INPUT

LINE INPUT([#] filenumber, varname)

Reads a single line from a file opened with Sequential access (String).


filenumberThe number of the file (Integer).
varnameThe variable to contain the line of text (String).

REMARKS
* For an example refer to the page under Reading Text Files
* The line of text must end with a carriage return or carriage return line feed.
* You can use the CLOSE statement to close a text file.
* You can use the INPUT Function to read a number of characters from a file.
* You can use the INPUT Statement to read data from a file and assigns the data to a list of variables.
* You can use the OPEN statement to open a text file.
* The equivalent .NET function is Microsoft.VisualBasic.FileSystem.LineInput
* For the Microsoft documentation refer to learn.microsoft.com

Dim TextLine As String 

Open "C:\Temp\MyText.txt" For Input As #1

Do While Not EOF(1)
   Line Input #1, TextLine
   Debug.Print TextLine
Loop

Close #1

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top