WriteBlankLines Method

 

Description

 

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

 

PowerBASIC Syntax

 

METHOD WriteBlankLines ( _

BYVAL nLines AS LONG _

)

 

Arguments

 

 

nLines

LONG. Number of newline characters you want to write to the file.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem

DIM pFolder AS IFolder

DIM pStm AS ITextStream

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Get a reference to the IFolder interface

pFolder = fso.GetFolder(UCODE$("C:\MyFolder"))

' Create a text stream

pStm = pFolder.CreateTextFile(UCODE$("Test.txt"), %VARIANT_TRUE, %VARIANT_FALSE)

' Write a string and an end of line to the stream

pStm.WriteLine UCODE$("This is a test.")

' Write more strings

pStm.Write UCODE$("This is a string.")

pStm.Write UCODE$("This is a second string.")

' Write two blank lines (the first will serve as an end

' of line for the previous write instructions) and another

' string and end of line to the stream

pStm.WriteBlankLines 2

pStm.WriteLine UCODE$("This is the end line.")

' Close the file

pStm.Close

 

Valid XHTML 1.0 Transitional