DIAdem Help

Method: ReadLine for TextStream

  • Updated2024-09-12
  • 1 minute(s) read

Method: ReadLine for TextStream

Reads a text file line of a TextStream file up to the end of line identifier.

sReadLine = Object.ReadLine
ObjectTextStream
Object with this method
sReadLineString
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

Log in to get a better experience