DIAdem Help

Method: SkipLine for TextStream

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

Method: SkipLine for TextStream

Skips a line when reading a TextStream file.

Object.SkipLine
ObjectTextStream
Object with this method

The following example opens a text file into which it writes two text lines. Then the example opens the file for reading, skips the first line, and returns the second line:

Function SkipOneLine(sFile)
  Const ForReading = 1, ForWriting = 2
  Dim fso, oMyFile
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set oMyFile= fso.OpenTextFile(sFile, ForWriting, True)
  oMyFile.Write "First Line" & vbCrLf & "Second Line"
  Set oMyFile = fso.OpenTextFile(sFile, ForReading)
  oMyFile.SkipLine
  SkipOneLine = oMyFile.ReadLine
End Function

See Also

Objects Overview

Log in to get a better experience