HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
The TextStream object is used to access the contents of a text file
The TextStream object is used to access the contents of text files.
The following code creates a text file (c:\test.txt) and then writes some text to the file (the variable f is an instance of the TextStream object):
To create an instance of the TextStream object you can use the CreateTextFile or OpenTextFile methods of the FileSystemObject object, or you can use the OpenAsTextStream method of the File object.
The TextStream object's properties and methods are described below:
Properties
Property | Description |
---|---|
AtEndOfLine | Returns true if the file pointer is positioned immediately before the end-of-line marker in a TextStream file, and false if not |
AtEndOfStream | Returns true if the file pointer is at the end of a TextStream file, and false if not |
Column | Returns the column number of the current character position in an input stream |
Line | Returns the current line number in a TextStream file |
Methods
Method | Description |
---|---|
Close | Closes an open TextStream file |
Read | Reads a specified number of characters from a TextStream file and returns the result |
ReadAll | Reads an entire TextStream file and returns the result |
ReadLine | Reads one line from a TextStream file and returns the result |
Skip | Skips a specified number of characters when reading a TextStream file |
SkipLine | Skips the next line when reading a TextStream file |
Write | Writes a specified text to a TextStream file |
WriteLine | Writes a specified text and a new-line character to a TextStream file |
WriteBlankLines | Writes a specified number of new-line character to a TextStream file |