Jump to content

Lua Programming/include

From Wikibooks, open books for an open world

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

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

[edit | edit source]

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"