註解 (Comment)

註解並不會被作為程式的一部分執行,他的作用在於將程式碼文件化:提醒開發者本人未來要在程式內完成的工作,或幫助他人理解程式碼。Lua 支援兩種註解:單行註解、多行註解。

單行註解 (Single line comment)

-- Two dashes make the rest of the line a comment

多行註解 (Multiline comment)

--[[
    Two square brackets in a row after two
    dashes make
    a multi-line comment.
—]]

results matching ""

    No results matching ""