lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I don't understand your question. What is SetEventFunction() ? A C function
In that case, as you can lua_ref func(), you can lua_ref theObject just as
well for later use.
And if SetEventFunction() is unrelated, you know there is a global named
"theObject" which is your table, and a global named "func" which is your
function, and you can use the LUA API to retrieve both by name and do
whatever you want, including lua_ref()-ing them for later use.



-----Message d'origine-----
De : jose_marin2 <>
Envoyé : mercredi 22 janvier 2003 15:33
À : Multiple recipients of list
Objet : How to pass a table as a parameter?


Im trying to do this:

in Lua:


function CreateObject()
local Object = {}

function Object:DoSomething()

return Object


function func(obj)



theObject = CreateObject()

SetEventFunction(theObject, func)


In C, I must call "func", passing as parameter the table 

I know how to get the address and call func(via lua_getref), but how 
to get the address of a table, and pass it to the function call?