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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See the
requireentry 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.pathentry in the the Lua Reference ManualThis wiki page describes ways of creating modules to load with
require.