Method: ReadLine for TextStream
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: ReadLine for TextStream
Method: ReadLine for TextStream
Reads a text file line of a TextStream file up to the end of line identifier.
sReadLine = Object.ReadLine
| Object | TextStream Object with this method |
| sReadLine | String Receives the read text line. |
The following example reads in a file line by line to the end of the file:
Function ReadFile(sFile) Const ForReading = 1 Dim fso, oMyFile, sOutput Set fso = CreateObject("Scripting.FileSystemObject") Set oMyFile = fso.OpenTextFile(sFile, ForReading, False) Do While oMyFile.AtEndOfStream <> True sOutput = sOutput & oMyFile.ReadLine & VBCrLf Loop oMyFile.Close ReadFile = sOutput End Function
See Also
Related Topics
Command: ExecuteExclusiveBegin | Command: ExecuteExclusiveEnd | Command: ExecuteExclusiveEndAll