Reads text files sequentially.
Object functions
- close [1.14.9+]
Closes the file. Returns
truewhen it was closed successfully. - construct [1.14.9+]
Creates a TextFileReader and opens file for reading.
- file [1.14.9+]
Returns the name of the current or most recently opened file.
- has_next [1.14.9+]
Returns
truewhen another line is available. - is_open [1.14.9+]
Returns
truewhile the underlying file reader is open. - line_number [1.14.9+]
Returns the number of lines read from the current file. The first successful call to read_line changes this value from 0 to 1.
- open [1.14.9+]
Closes any previously opened file, then opens file for sequential reading. Returns
truewhen the file was opened successfully, orfalsewhen it could not be opened. - peek_line [1.14.9+]
Returns the next line without advancing the reader. Returns undefined when no line is available.
- read_line [1.14.9+]
Returns the next line and advances the reader. Returns undefined when no line is available.

There are no comments on this page.
Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you. The system temporarily stores IP addresses and browser user agents for the purposes of spam prevention, moderation, and safeguarding. This data is automatically removed after fourteen days. Your email address is stored so that replies can be sent to your email address.
Comments powered by BalfComment