Log In  


Does this work? It says in the version history for 0.1.4 "fixed: multi-line comments", without any more information. If multi-line comments are supported, what's the syntax? Thanks.



--[[
print(10) -- no action (comment)
--]]

http://www.lua.org/pil/1.3.html


Thanks!


By default, Lua comments - that is, text in the source code that is read as text instead of code - start at the double-hyphen and extend to the end of the line, so if (for example) you wanted to comment out a whole section of a document, you would have to put a double-hyphen at the beginning of every single line. A multi-line comment lets you just put a start-comment thing at the top and end-comment thing at the bottom and be done with it.

I don't know if that answers your question - just trying to be complete.


ledonna, did you make the two games that are linked in your profile?

sorry for the question — the bbs is for some reason the target of spambots and very short comments on very old threads are suspicious.


it’s in the first reply here and in the official docs: https://www.lexaloffle.com/dl/docs/pico-8_manual.html#Lua_Syntax_Primer


Here now if this is still not understood, in a new line of your source code type out two minus signs followed by two open square brackets "["

So it appears as such:

--[[

Either start typing comments after that or press ENTER for a new line or two and start entering comments. To close your comments type the reverse, in this case two closed square brackets and two minus signs. It will appear as this:

]]--

For a single line of comments that affects only that line, use double minus by itself, no square brackets. Regular code can continue after that single line. Watch the text change colors to denote you are typing a remark or code.

Hope This Helps !


The dashes are not necessary for the closing marker, as documented in the PIL and pico8 docs links.


Oh ? Thank you, @merwok. That'll save 2-bytes. Could be critical in large code.



[Please log in to post a comment]