Lua Basics

Comments

In Lua, the characters indicate that the rest of the line is a comment:

myvar = 98.6 -- this is a normal temperature
-- this line consists of nothing but a comment --

To create a multi-line comment, use followed by [[ and ]]:

--[[ this comment
is a multi-line comment ]]

As in strings, you can put one or more = characters between the two open bracket [ characters and the two close bracket ] characters:

--[==[ this comment
contains some bracket characters [] [[]]
but does not end until here ]==]

--[=[ this comment also contains
some [] bracket characters ]=]
Tagged:

Leave A Comment?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.