TextStream Object

The TextStream object allows you to access text files sequentially. This allows you to read, write, or append characters or lines to a text file. The TextStream object's properties and methods are listed in Table 19.13 and Table 19.14, respectively.

Table 19.13. TextStream Object Properties

Property

Description

AtEndOfLine*

A Boolean value that indicates whether the current position within the file is at the end of a line

AtEndOfStream*

A Boolean value that indicates whether the current position within the file is at the end of the text file

Column

An integer value that indicates the column number of the current position in a line of text

Line

An integer value that indicates the line number within a text file

Table 19.14. TextStream Object Methods

Method

Description

Close*

Closes the current text file. Once closed, the file must be reopened before you can read from or write to it.

Read

Reads a specified number of characters from an open text file.

ReadAll

Reads all the characters from an open text file into a string.

ReadLine*

Reads an entire line of text from an open text file.

Skip

Skips over a specified number of characters in an open text file. In conjunction with the Read method, the Skip method allows you to read a number of characters starting at a specific position.

SkipLine

Skips over a specified number of lines in an open text file.

Write*

Writes a specified string to an open text file.

WriteBlankLines

Writes a ...

Get ASP in a Nutshell, 2nd Edition 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.