Name

TextStream.ReadAll Method

Syntax

                  oTextStreamObj
                  .ReadAll

Return Value

A Variant of subtype String.

Availability

R

Description

Reads the entire file or input stream into memory.

Rules at a Glance

  • For large files, use the ReadLine or Read methods to reduce the load on memory resources.

  • Files opened for writing or appending can’t be read; you must first close the file and reopen it using the ForRead constant.

  • When used to read the standard input stream from the keyboard, the ReadAll method pauses program execution and polls the keyboard until the AtEndOfStream symbol is encountered. For this reason, the ReadAll method should not be executed repeatedly in a loop.

Get VBScript in a Nutshell 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.