File.OpenAsTextStream()

JScript3.0+Syntax

							file.OpenAsTextStream(iomode, format)

Description

The OpenAsTextStream method is used to open a specified text stream that can be used to read or write to a file. This method takes two parameters. The first parameter, iomode, specifies the mode for the file. Valid modes are ForReading, ForWriting, and ForAppending. The second parameter, format, specifies the format of the file. The default value is ASCII, however you can have one of the three settings shown in Table 9.11.

Table 9.11. Settings for the format Parameter
ConstantValueDescription
TristateUseDefault-2Opens the file using the systemdefault
TristateTrue-1Opens the file as Unicode
TristateFalse0Opens the file as ASCII mode

Example

Listing 9.59 ...

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.