Skip to content
Jérôme Leclercq edited this page Dec 8, 2020 · 2 revisions

API: print

Description:

Prints its parameter to the execution output.

Prototype:

print(...)

Parameters:

  1. ...: Variadic parameters to print.

Remarks:

  1. This function is from the Lua standard (see print in the official Lua manual).
  2. This function takes variadic parameters, which means it can take from 0 to n parameters.
  3. All parameters are converted to string as if tostring was called on them before passing them to this function.
  4. When called with more than one argument, each printed argument will be separated by a tabulation (\t character)

Example code

-- Prints "Hello world" to the output
print("Hello world")

-- Prints "true 1.24 str vec2(10, 20)" to the output
print(true, 1.24, "str", Vec2(10, 20))

-- Prints the table pointer (something like "table: 0x7f3fbd713598")
print({ "Hello", "World", key = "value" })

Clone this wiki locally