Implemented in version 2.0
The TextStream object provides sequential access to the contents of any file where the contents are in text-readable form. You can create an instance of the TextStream object using the CreateTextFile or OpenTextFile methods of the FileSystemObject object, or alternatively by using the OpenAsTextStream method of the File object.
In the following code the CreateTextFile method is used on the FileSystemObject to return the TextStream object, "testfile". This TextStream object is then manipulated using the WriteLine and Close methods.
Dim filesys, testfile
Set filesys =
"Your text goes here."
Every instance of a TextStream object has an internal pointer that points to a specific place in the file. When first opening the stream, this pointer is positioned at the first character in the file. The pointer will then move around as you manipulate the TextStream object using its methods and properties.
Returns a Boolean value. If the file pointer is positioned immediately before the file's end-of-line marker, the value is True, and False otherwise.
Returns a Boolean value. If the file pointer is positioned at the end of a file, the value is True, and False otherwise.
Returns the current position of the file pointer within the current line. Column 1 is the first character in each line.
This property returns the current line number in a text file.
Closes a currently open TextStream file.
This method reads the number of characters you specify from a Textstream file and returns them as a string.
This method reads the entire contents of a text file and returns it as a string.
Reads a single line (excluding the newline character) from a TextStream file and returns the contents as a string.
Causes the file pointer to skip a specified number of characters when reading a TextStream file. Can be a positive or negative number.
Moves the file pointer from its current position to the beginning of the next line.
This method writes a supplied string to an open TextStream file.
Writes a supplied string to a TextStream file, followed by a new line character.
Used to write a number of consecutive newline characters (defined with the lines parameter) to a TextStream file.
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.