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.

P#19074 2016-03-05 17:55 ( Edited 2016-03-05 22:55)

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

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

P#19084 2016-03-06 02:34 ( Edited 2016-03-06 07:34)

Thanks!

P#19097 2016-03-06 22:09 ( Edited 2016-03-07 03:09)

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.

P#113433 2022-06-21 03:52

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.

P#113435 2022-06-21 07:41 ( Edited 2022-06-21 07:41)

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

P#113834 2022-06-30 11:29

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 !

P#113877 2022-07-01 16:30 ( Edited 2022-07-01 18:07)

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

P#113881 2022-07-01 18:51

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

P#113899 2022-07-02 13:59

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 12:34:01 | 0.018s | Q:19