Comments

From Wiki pLua

Jump to: navigation, search

In Lua and derived languages (like pLua) you can use a single and multi-line comments.

Single line example:

gui.title("test")
-- i'm a single line comment
gui.ln()

The multi-lines comments begin with '--[[' (double hyphen, double square brackets) and end with ']]' (double square brackets).

Multi-line example:

print("this is normal line")
--[[
function foo(parameter)
   gui.title("other test")
end
]]
print("the book is on the table and not is a comment line")


A useful trick lets you quickly remove a multi-line comment... change the final brackets to "--]]" : this turns them into a single-line comment and the result is to uncomment all the "foo()" code.

Back to basics about Lua

Personal tools