DIAdem Help

Property: AtEndOfStream for TextStream

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

Property: AtEndOfStream for TextStream

Checks whether the read pointer is just before the end of the file of a TextStream file.

Object.AtEndOfStream
ObjectTextStream
Object with this property
Object.AtEndOfStreamBoolean value with read access
The value is True if the read pointer is before the end of file character, otherwise the value is False.

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