This topic has not yet been rated - Rate this topic

WriteBlankLines Method (Windows Script Host)

Sends a specified number of blank lines (newline characters) to an output stream.

                      object.WriteBlankLines(intLines) 
object

StdOut or StdErr text stream objects.

intLines

Integer value indicating the number of blank lines you want to write to the stream.

Calling the WriteLine method without supplying the strText argument is equivalent to calling WriteBlankLines(1). 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 following code demonstrates the WriteBlankLines method.

Dim StdIn, StdOut
Set StdIn = WScript.StdIn
Set StdOut = WScript.StdOut

Do While Not StdIn.AtEndOfStream
     str = StdIn.ReadLine
     StdOut.Write "Line " & (StdIn.Line - 1) & ": " & str
     StdOut.WriteBlankLines 1
Loop
var stdin = WScript.StdIn;
var stdout = WScript.StdOut;

while (!stdin.AtEndOfStream)
{
     var str = stdin.ReadLine();
     stdout.Write("Line " + (stdin.Line - 1) + ": " + str);
     stdout.WriteBlankLines(1);
}

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.