printError

From ComputerCraft
Jump to: navigation, search

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

Returns number linesPrinted
API BIOS globals
Source CC:Tweaked (source)

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

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