Function; dofilepath - HWRM/KarosGraveyard GitHub Wiki

dofilepath(<file_path>)

Description

See Lua's stock function dofile:

Receives a file name, opens the named file, and executes its contents as a Lua chunk, or as pre-compiled chunks. When called without arguments, dofile executes the contents of the standard input (stdin). If there is any error executing the file, then dofile returns nil. Otherwise, it returns the values returned by the chunk, or a non-nil value if the chunk returns no values. It issues an error when called with a non-string argument.

You can use this to import code from other files.

Arguments

Param Type Description
file_path string The path of the file to be loaded. See Tutorial; Relative Paths

Example

dofilepath("data:scripts/utilityfunctions.lua");

Related Pages

⚠️ **GitHub.com Fallback** ⚠️