Writes a specified string and newline character to a TextStream file.
object.WriteLine([string])
The following example illustrates use of the WriteLine method:
[JScript] var fso, f; fso = new ActiveXObject("Scripting.FileSystemObject"); f = fso.CreateTextFile("c:\\testfile.txt", true);f.WriteLine(
"This is a test.")
; f.Close(); [VBScript] Function WriteLineToFile Const ForReading = 1, ForWriting = 2 Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)f.WriteLine
"Hello world!"f.WriteLine
"VBScript is fun!" Set f = fso.OpenTextFile("c:\testfile.txt", ForReading) WriteLineToFile = f.ReadAll End Function
Write Method | WriteBlankLines Method
Applies To: TextStream Object