DIAdem Help

Property: Line for TextStream

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

Property: Line for TextStream

Specifies the current line number of the file pointer in a TextStream file. After the file is open, the property has the value 1.

Object.Line
ObjectTextStream
Object with this property
Object.LineLongInteger with read access

The following example returns the number of lines in a file:

Function GetFileLines(sFile)
  Const ForReading = 1
  Dim fso, oMyFile, sOutput
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set oMyFile = fso.OpenTextFile(sFile, ForReading, False)
  sOutput = oMyFile.ReadAll
  GetFileLines = oMyFile.Line
  oMyFile.Close
End Function

Log in to get a better experience