Partager via


Skip Method (Windows Script Host)

Skips a specified number of characters when reading from an input text stream.

                      object.Skip(characters) 

Arguments

  • object
    StdIn text stream object.

  • characters
    Integer value indicating the number of characters you want to skip.

Remarks

The StdIn, StdOut, and StdErr properties and methods work when running the script with the CScript.exe host executable file only. An "Invalid Handle" error is returned when run with WScript.exe. The position pointer moves forward by the number of characters (bytes) specified in the argument characters. You cannot use the Skip method to skip backwards through a file (negative character values are not supported). The Skip method is limited to the open for reading mode only (you cannot skip a specified number of characters when writing to an output stream).

Example

The following code uses the Skip method to jump over the first character in a text stream, read a line from the keyboard, and write it to the StdOut text stream.

WScript.StdIn.Skip 1
Input = WScript.StdIn.ReadLine
WScript.StdOut.Write Input
WScript.StdIn.Skip(1);
Input = WScript.StdIn.ReadLine();
WScript.StdOut.Write(Input);

Applies To:

StdIn Property (WScript)

See Also

Reference

TextStream Object