LuaScript.LoadFunction Method
Loads a function from Lua script by name to prepare to execute it.

LoadFunction(
name
as String)
as Boolean
Parameters
- name
- The name of the function to load.
Returns
- Boolean
- True if loading the function was successful, else false.
Remarks
The normal flow would be:
1. Load the function.
2. Add parameters to it.
3. Call the function.
4. Get back return parameters.
if lua.LoadFunction("test") then
lua.Push(5)
if lua.CallFunction(1,1) then
MsgBox "The result is: " + Str(lua.GetInteger(-1,true))
else
MsgBox lua.GetLastErrorMessage()
end if
else
MsgBox "Could not load function called test"
end if
See Also
LuaScript Class