LuaScriptContext.PushFunction Method
Pushes a function to the stack. (This is often used to define classes from within Xojo or Real Studio that are exposed to Lua)

PushFunction(
function
as Ptr)
Parameters
- function
- The address of the REALbasic function.
Remarks
Note that the signature of the function always has to be:
Function [FunctionName](lua as Ptr) As Integer
Dim i as Integer
lua.NewTable()
lua.Push("New")
lua.PushFunction(AddressOf LuaVectorClass.NewVector)
lua.SetTableValue()
lua.Push("Magnitude")
lua.PushFunction(AddressOf LuaVectorClass.Magnitude)
lua.SetTableValue()
lua.SetGlobal("CustomVector")
See Also
LuaScriptContext Class