Type Function Library (globals) Return value none Revision Current Public Release (2017.3184) Keywords print, write, console See also io.write()
Receives any number of arguments and prints their values to
stdout in the Corona Simulator Console, Xcode, ADB, etc.
print() is not intended for formatted output, but rather as a quick way to show a value, typically for debugging. For formatted output, use string.format.
If you are concatenating potentially
nil values for output, convert them to strings using the tostring() function:
local nilValue = nil print( "Value: " .. tostring(nilValue) )
print( [...] )
In the Corona Simulator Console, a string output via
print() can be highlighted as a "warning" or "error" by prefixing it with
ERROR: respectively. For example:
print( "WARNING: " .. "This is a warning!" ) print( "ERROR: " .. "This is an error!" )
WARNING: This is a warning!
ERROR: This is an error!
print( "Hello world!" ) -- OUTPUT: Hello world!