Compartir a través de


WriteBlankLines Method

 

Writes a specified number of newline characters to a TextStream file.

Syntax

object.WriteBlankLines(lines)

Arguments

  • object
    Required. Always the name of a TextStream object.

  • lines
    Required. Number of newline characters you want to write to the file.

Remarks

The following example illustrates the use of the WriteBlankLines method:

function WriteBlanksDemo()
{
   var fso, f, r;
   var ForReading = 1, ForWriting = 2;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   f = fso.OpenTextFile("c:\\testfile.txt", ForWriting, true);
   f.Write("Hello world!");
   f.WriteBlankLines(2);
   f.Write("JScript is fun!");
   f.Close();
   f = fso.OpenTextFile("c:\\testfile.txt", ForReading);
   r = f.ReadAll();
   return(r);
}
Function WriteBlankLinesToFile
   Const ForReading = 1, ForWriting = 2
   Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
   f.WriteBlankLines 2 
   f.WriteLine "Hello World!"
   Set f = fso.OpenTextFile("c:\testfile.txt", ForReading)
   WriteBlankLinesToFile = f.ReadAll
End Function

Applies To:

TextStream Object

See Also

Write Method (FileSystemObject)
WriteLine Method (FileSystemObject)