Lua Programming/How to Lua/include

The require function is used to incorporate code from an included header file.

Inclusion statements are normally placed near the top of a source fileEdit

Inclusion statements are normally placed near the top of a source file. Note that the file extension is omitted from the specified header filename:

-- Include the contents of file foobar.lua
require "foobar"
Last modified on 29 May 2011, at 10:00