Skips a specified number of characters when reading a TextStream file.
object.Skip(characters) |
Arguments
- object
-
Required. Always the name of a TextStream object.
- characters
-
Required. Number of characters to skip when reading a file.
Remarks
Skipped characters are discarded.
The following example illustrates the use of the Skip method:
JScript | Copy Code |
---|---|
function SkipDemo() { var fso, f, r; var ForReading = 1, ForWriting = 2; fso = new ActiveXObject("Scripting.FileSystemObject") f = fso.OpenTextFile("c:\\testfile.txt", ForWriting, true); f.WriteLine("Hello world!"); f.WriteLine("JScript is fun"); f.Close(); f = fso.OpenTextFile("c:\\testfile.txt", ForReading); f.Skip(6); r = f.ReadLine(); return(r); } |
Visual Basic Script | Copy Code |
---|---|
Function SkipTextFile 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!" Set f = fso.OpenTextFile("c:\testfile.txt", ForReading) f.Skip(6) SkipTextFile = f.ReadLine End Function |