Import std.core.print
std.core.print
Writing to stdout and stderr, and reading lines from stdin.
The program's console: what it writes to stdout and stderr, which show what it wrote in its order, and the lines it reads from stdin. std reaches the runtime through Extern "runtime".
Examples
Write("no line break, ")
Print("then one")
PrintError("to stderr")
WriteError("also to stderr\n")
Flush()std/core/print.fb
Functions
Print
function
Public Function Print(values: Printable...)
Prints the values, as "{x}" shows each, with a space between each two, and a line break. A
String holding a NUL prints whole.
Examples
Print("Hello,", "world") // Hello, world
Print("{1 + 1} apples") // 2 apples
Write
function
Public Function Write(values: Printable...)
Prints the values like Print, without the line break.
PrintError
function
Public Function PrintError(values: Printable...)
Prints the values like Print, to stderr.
WriteError
function
Public Function WriteError(values: Printable...)
Prints the values like Write, to stderr.
Flush
function
Public Function Flush()
Sends on what's been written to stdout and stderr, as the program's end and Input do anyway.
Input
function
Public Function Input(prompt: String = ""): String?
Writes the prompt, then reads a line, without its line break, "\r\n" too. Null at the end of
the input. Nothing else runs meanwhile.
Examples
Local name = Input("What's your name? ")
If name != Null Then Print("Hello, {name}!")
InputAsync
function
Public Function InputAsync(prompt: String = ""): Task<String?>
Input's Async twin: writes the prompt, then gives a Task of the line, which the main thread
goes on from meanwhile. Lines go to Input and InputAsync in the order they ask.
Report an issue with this page or with FutureBlitz on GitHub.