OpenAsTextStream Method |
Description
Opens a specified file and returns a TextStream object that can be used to read from, write to, or append to the file.
PowerBASIC Syntax
Arguments
Settings
The IOMode argument can have any of the following settings:
The format argument can have any of the following settings:
Remarks
The OpenAsTextStream method provides the same functionality as the OpenTextFile method of the FileSystemObject. In addition, the OpenAsTextStream method can be used to write to a file.
Example [PowerBASIC]
#INCLUDE "windows.inc" #INCLUDE "scrrun.inc"
DIM fso AS IFileSystem DIM pFile AS IFile DIM pStm AS ITextStream
' Create an instance of the FileSystemObject fso = NEWCOM "Scripting.FileSystemObject" ' Get a reference to the IFile interface pFile = fso.GetFile(UCODE$("C:\MyPath\MyFile.txt")) ' Open the file as text stream pStm = pFile.OpenAsTextStream(%IOMode_ForReading)
|