WSH » Objects » TextStream

A Textstream object is returned by the StdErr, StdIn and StdOut properties of the WScript object. For full details of this object and its properties and methods, see the VBScript Textstream object Quick Reference.

Properties

AtEndOfLine

Syntax: object.AtEndOfLine

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.

AtEndOfStream

Syntax: object.AtEndOfStream

Returns a Boolean value. If the file pointer is positioned at the end of a file, the value is True, and False otherwise.

Column

Syntax: object.Column

Returns the current position of the file pointer within the current line. Column 1 is the first character in each line.

Line

Syntax: object.Line

This property returns the current line number in a text file.

Methods

Close

Syntax: object.Close

Closes a currently open TextStream file.

Read

Syntax: object.Read(characters)

This method reads the number of characters you specify from a Textstream file and returns them as a string.

ReadAll

Syntax: object.ReadAll

This method reads the entire contents of a text file and returns it as a string.

ReadLine

Syntax: object.ReadLine

Reads a single line (excluding the newline character) from a TextStream file and returns the contents as a string.

Skip

Syntax: object.Skip(characters)

Causes the file pointer to skip a specified number of characters when reading a TextStream file. Can be a positive or negative number.

SkipLine

Syntax: object.SkipLine

Moves the file pointer from its current position to the beginning of the next line.

Write

Syntax: object.Write(string)

This method writes the parameter string to an open TextStream file.

WriteBlankLines

Syntax: object.WriteBlankLines(lines)

Used to write a number of consecutive newline characters (defined with the lines parameter) to a TextStream file.

WriteLine

Syntax: object.WriteLine([string])

Writes the optional parameter string to a TextStream file, followed by a new line character.

See Also: