Two Getting Started with Lua scripting language

Source: Internet
Author: User
Tags lua

The previous article forgot to insert the code, convenient paste copy ...

Function

For C language is

void AA ()//C language is with void{  print (" This is a function ")} 

LUA has become

function AA ()-- defines a functional print (" This is a function ") Endaa ()--Call function

function AA (str)- defines a functional print (" passed in "). STR) ENDAA (123)--Call function

Look at the return value.

function aa (str) return str--= AA ("qq") print (BB)

Multiple returns can be returned at once

function AA ()    local A=1; b=2; c=3return  a,b,cendfunction BB ()    print (a)    print (b) endprint (AA ()) BB ()

Write here today, the network is not good, really afraid of a careless will not

Write too little to add something else----directly copy and paste someone else's written,,,,, standing on someone's shoulder ... Since the blog can directly copy and paste pictures more convenient,,,

Resources

Link: http://pan.baidu.com/s/1i5I87jv Password: 3uy3

Two Getting Started with Lua scripting language

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.