LUA annotation syntax, lua Annotation

Source: Internet
Author: User

LUA annotation syntax, lua Annotation

The server code has been completed, the client is being optimized, and the game will be launched soon. Nothing has been done recently. The boss asked me to start learning the project Anarchy. The code in it is a preferred C ++, including lua, I haven't learned lua yet. I read the LUA code, which is similar to Delphi,

The following is a comment:

Single line comment: "--" is used to comment on the characters after the comment, similar to the C language comment after the ISO C90 "//"

Multi-line comment: Use "-- [" "]" to comment, similar to the C language "/*""*/".


LUA basic syntax

In lua
{} Is similar to an array in c.
Indicates that the table {1, 2} is assigned to C.
1 and 2 are not independent, but are assigned to a in the form of a table.
If
A = 3
Print (a) outputs 3
Now
A = {7, 8}
Print (a [1]) will output 1
Print (a [2]) will output 2
Understand.

LUA syntax

It means that you have compared the number with the nil value, and naturally get an error.
In addition, I have run the code you posted, so there is no problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.