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