Print

From codeTank

Jump to: navigation, search

Contents

Description

print is a debugging function used to send strings to Brain Damage's output window. It automatically outputs a newline at the end of the function. Note that print should be used only for debugging purposes - to display quick information to the user, alert is a better choice. For complicated displays, consider using paint.print, window.createstatic, or window.createedit instead.

Arguments

print() -- prints a newline
print(text) -- prints the text
print(text, text2) -- prints the text, separated by a tab
print(text, text2, text3) -- etc, etc, etc...

print accepts a variable number of arguments. Each argument is converted to a string by invoking the tostring function internally, and outputted. If there is more than one argument, then a tab is inserted between outputs.

Returns

print doesn't return anything.

Example

print("Hello World!") -- outputs: Hello World!
print(print)          -- outputs: function: 00A4DF08
print(1, 2, 3, 4)     -- outputs: 1       2       3       4

See Also