Name
TextStream.ReadLine Method
Syntax
oTextStreamObj
.ReadLineReturn 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
ForReadconstant.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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access