Reference
Console
Write
| Input | An argument of any type. |
|---|---|
| Output | It writes the argument in the standard output and returns it. |
Signature
console_write(a: Any): AnyExample
console_write("hello") // prints "hello" and returns "hello"Write new line
| Input | An argument of any type. |
|---|---|
| Output | It writes the argument in the standard output, followed by a newline, and returns it. |
Signature
console_writeLn(a: Any): AnyExample
console_writeLn("hello") // prints "hello\n" and returns "hello"Read
| Output | Reads a line from the standard input and returns it as a string. Once the input has ended, it returns the empty string, and every call after that returns the empty string too. |
|---|
Signature
console_read(): StringExample
console_read() // waits for input and returns the entered stringNote: A blank line and an ended input both read as the empty string, so a program that reads in a loop needs its own way to stop, such as a sentinel line.
Note: This function is not implemented on the web platform.