Skip to content
FutureBlitz

    Install

    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

    std/core/print.fb, line 40

    Write function

    Public Function Write(values: Printable...)

    Prints the values like Print, without the line break.

    std/core/print.fb, line 45

    PrintError function

    Public Function PrintError(values: Printable...)

    Prints the values like Print, to stderr.

    std/core/print.fb, line 50

    WriteError function

    Public Function WriteError(values: Printable...)

    Prints the values like Write, to stderr.

    std/core/print.fb, line 55

    Flush function

    Public Function Flush()

    Sends on what's been written to stdout and stderr, as the program's end and Input do anyway.

    std/core/print.fb, line 60

    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}!")

    std/core/print.fb, line 73

    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.

    std/core/print.fb, line 79

    Report an issue with this page or with FutureBlitz on GitHub.