Reference · Files and processes
read_line
signature
read_line() -> str | null | error(str)What it does
The next line a script is given, without its line break, or null at the end of what is
piped in. A loop of read_line() reads a file of any size a line at a time.
Examples
in a program
// quillo run upper.qwe < notes.txtlet line = read_line()while line != null { print(upper(line)) line = read_line()}Edge cases
- A
\r\nending is taken off as\nis; an empty line is"", notnull. - The last line counts with or without a line break after it.
- From a terminal it waits for a line to be typed.
Errors
As stdin, it is for a script: in a program that serves it is a runtime error.
Chaining
None: it takes nothing.
See also
Thread
Thread 0 posts
On read_line(): questions, tips, corrections, and code that uses it.
No posts yet. The first one opens the thread.
Edit this page on GitHub · every example's output was made by running it (tools/refcheck.mjs) · questions on Discord or r/quillo