Print()

Syntax

Print(Text$)
Description
Displays the specified 'Text$' in the console.

Parameters

Text$ The text to display. In graphical mode the length of the string can't excess the width of the console, otherwise the string will be truncated (have the end cut off).

Return value

None.

Remarks

In graphical mode it's possible to change the position with the function ConsoleLocate(). To change the appearance of the string when it is printed, the function ConsoleColor() should be used.

The cursor will be moved to the next character after the end of the string that is printed. If you print over the right edge of the console the text will wrap around to the left edge on the next line down. If you print off the bottom of the console window, the console window will scroll its contents up.

To output raw data on the non-graphical console (for pipe communication) WriteConsoleData() can be used.

Example

  If OpenConsole()
    Print("This is quite a long string.")
    Print("You see how this one joins onto the end of the previous one?")
    Print("That is because the cursor moves to the end of the string and not onto a new line.")
    Print("Hopefully the text will also have been wrapped by now.")

    PrintN("")
    PrintN("")
    PrintN("Press return to exit")
    Input()
  EndIf

See Also

PrintN(), Input()

Supported OS

All

<- OpenConsole() - Console Index - PrintN() ->