Name

TextStream.ReadLine Method

Syntax

                  oTextStreamObj
                  .ReadLine

Return Value

A String.

Availability

R

Description

Reads a line of the text file or input stream into memory, from the start of the current line up to the character immediately preceding the next end-of-line marker.

Rules at a Glance

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

  • The ReadLine method causes the file pointer to advance to the beginning of the next line, if there is one.

  • When used to retrieve standard input from the keyboard, the ReadLine method pauses program execution and waits until the end-of-line character (i.e., the Enter key) has been pressed. Unless your script expects to retrieve just one line of input, it’s best to call the ReadLine method repeatedly in a loop.

Get VBScript 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.