LUA Programming in 8 Hours, For Beginners, Learn Coding Fast: Lua Quick Start Guide & Exercises by Yao Ray

LUA Programming in 8 Hours, For Beginners, Learn Coding Fast: Lua Quick Start Guide & Exercises by Yao Ray

Author:Yao, Ray [Yao, Ray]
Language: eng
Format: epub
Publisher: In Easy Step by Step, Teach Yourself eBook & Book
Published: 2021-09-01T16:00:00+00:00


Example 5.5

module = {} -- define a module

module . variable = "TypeScript in 8 Hours" -- define a variable

function module . func() -- define a function

print("Shell Scripting in 8 Hours")

end

return module -- return to the file that requires the module

Please save the file as “ myModule.lua ” .

The following is another file that requires the myModule . lua .

require(" myModule ") -- import the module file

print(module . variable) -- use the variable of the module

module . func() -- use the function of the module



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.