[Overview][Types][Classes][Procedures and functions] | Reference for unit 'pLua' (#pLua)

# plua_RegisterMethod

## Declaration

Source position: plua.pas line 46

`procedure plua_RegisterMethod(`
`l: Plua_State;`
`aMethodName: AnsiString;`
`MethodPtr: lua_CFunction;`
`totable: Integer = LUA_GLOBALSINDEX`
`);`

## Arguments

`l` |  | PLua_State to work with.
`aMethodName` |  | Name of the method in the Lua environemnt.
`MethodPtr` |  | Address of the method to call.
`totable` |  | Table index to put the method into, if none is specified then LUA_GLOABLSINDEX is used. Thus, making the method global.

## Description

Used to register a Pascal method (that follows the lua_CFunction standard) into the Lua environemnt.