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.
Constant | Value | Description |
---|---|---|
TristateUseDefault | -2 | Opens the file using the systemdefault |
TristateTrue | -1 | Opens the file as Unicode |
TristateFalse | 0 | Opens the file as ASCII mode |
Example
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.