SkipLine Method

Skips the next line when reading a TextStream file.

object.SkipLine

The object is always the name of a TextStream object.

Remarks

Skipping a line means reading and discarding all characters in a line up to and including the next newline character. An error occurs if the file is not open for reading.

The following example illustrates use of the SkipLine method:

Function SkipLineInFile
   Const ForReading = 1, ForWriting = 2
   Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
   f.Write "Hello world!" & vbCrLf & "VB Script is fun!"
   Set f = fso.OpenTextFile("c:\testfile.txt", ForReading)
   f.SkipLine
   SkipLineInFile = f.ReadLine
End Function

See Also

Close Method | Read Method | ReadAll Method | ReadLine Method | Skip Method | Write Method | WriteLine Method | WriteBlankLines Method

Applies To: TextStream Object

Сайт создан в системе uCoz