I want to create a header file in Lua (header.lua), then execute the require
function to load it.
How do I execute require
to a file that I have created?
I want to create a header file in Lua (header.lua), then execute the require
function to load it.
How do I execute require
to a file that I have created?
Here
require
is the method who look variables.lua file inside codelibrary directorySee the
require
entry in the Lua Reference manual. The file "header.lua" must be somewhere in Lua's search path.You can see (and modify) the path at
See the
package.path
entry in the the Lua Reference ManualThis wiki page describes ways of creating modules to load with
require
.You have
loadfile
anddofile
, more info here