printError

Identical to print, however the arguments are printed in red, like an error.

ExamplePrint a basic string
Prints "Hello, world!" to the current term in red.
Code
<nowiki>
printError("Hello, world!")
    </nowiki>
Output
Hello, world!
ExamplePrint multiple strings
Prints "foo bar" to the current term in red.
Code
<nowiki>
printError("foo", "bar")
    </nowiki>
Output
foo bar
ExamplePrint multiple types
Prints strings and numbers to the current term in red, in a single print call.
Code
<nowiki>
local cats = 5
local dogs = 3
printError("Cats:", cats, "Dogs:", dogs)
    </nowiki>
Output
Cats: 5 Dogs: 3

printError
Function
Syntax
printError(
  • toPrint... : any
)

Returns number linesPrinted
API BIOS globals
Source CC:Tweaked (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.