Comments (Scripting): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Mr Doom Bringer
m Comments moved to Comments (Scripting): Comments page should probably be regular site comments, redirects will go here, I'll fix links.
>JulienDethurens
Redirected page to Comment (Scripting)
 
(42 intermediate revisions by 8 users not shown)
Line 1: Line 1:
__TOC__
#redirect [[Comment (Scripting)]]
 
== Introduction ==
 
This tutorial covers how to include comments in your script(s).
 
==Single-line comments==
 
A comment starts anywhere with a double hyphen (--) and runs until the end of the line:
 
<pre>
Example:
-- This is an example of a comment
</pre>
 
Comments do not appear in the output window.  They are mostly to help the programmer understand what a section of code is for in long, complicated scripts.
 
== Block comments ==
 
Lua also offers block comments, which start with the first double brackets and run until the corresponding double brackets:
 
<pre>
Example:
    --[[
This is an example
of a block comment.   
--]]
</pre>
 
Notice how this comment is on more than one line.  In the first example, it is limited to one line.
 
== See Also ==
 
[http://www.lua.org/pil/1.3.html 1.3 - Some Lexical Conventions]

Latest revision as of 21:15, 3 May 2012