Loads a Lua file and parses it
Opens the named file, parses it and returns the compiled chunk as a function. Does not execute it.
Compare to dofile, which executes it as well. That is, dofile is equivalent to the two lines of code above.
If there is an error in the loading process, for example the file is not found, or it is found but has a syntax error, then f will be nil and err will be the nature of the error.
See Also ...
assert - Asserts that condition is not nil and not false
Lua base functions
(Help topic: lua=loadfile)
Enter a search string to find matching documentation.
Gammon Software support
Forum RSS feed ( https://gammon.com.au/rss/forum.xml )