lua_pushstring(state,"object_index") lua_gettable(state,LUA_GLOBALSINDEX) lua_pushnumber(state,index) lua_gettable(state,-2) lua_pushstring(state,"update") lua_gettable(state,-2) lua_gettable(state,-1) ' I need to push the table here. Local err:Int = lua_pcall(state,1,0,0) If err <> 0 Local error:String = String.FromCString(lua_tostring(state,-1)) lua_pop(state,1) Print error End If lua_pop(state,1)
In this example let's say index = 1
And let us say that in lua there is a table:
object_index { [1] = {update = function(self) print(self.test) end, test = "Blaaaaar"} }
How can I pass the 'object_index[1]' table as the first (and only) argument to its own function 'update', in the above code?