[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: store pointer as a global
- From: Max Ischenko <max@...>
- Date: Wed, 13 Dec 2000 08:23:34 +0200
Hi there, Markus Ewald!
On Tuesday, 12 of December you wrote:
> Max Ischenko schrieb:
>
> > I'm newbie to lua and I wonder how one can setglobal a C pointer
> > from C code.
>
> Try
>
> nTag = lua_newtag(pLuaState);
> lua_pushusertag(pLuaState, pMyPointer, nTag);
> lua_setglobal(pLuaState, "VariableName");
>
> where nTag is an integer, pLuaState the state you created using lua_open().
>
> VariableName is the name of the global and pMyPointer the pointer you want
> to store as userdata in it.
Thank you for your explanaition.
--
Best regards, Maxim F. Ischenko.