TextStream.WriteLine()
JScript2.0+Syntax
textstream.WriteLine()
Description
The WriteLine() method of an instance of the TextStream object is used to write a string followed by a newline to the text file.
Example
Listing 9.136 opens a text file and writes a string followed by a newline to it. This file can be executed with the Windows Scripting Host (wscript.exe or cscript.exe).
Listing 9.136 Using the WriteLine() Method
// Create a FileSystemObject object var myFileSysObj = new ActiveXObject("Scripting.FileSystemObject") // Create a TextStream object var myTextStream = myFileSysObj.OpenTextFile("c:\\temp\\test.txt", 2, true) // Write a string followed by a newline to the file myTextStream.WriteLine("Hello, World!"); // Close the stream ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.