[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Problem w/lua_pushuserdata
- From: Edgar Toernig <froese@...>
- Date: Mon, 09 Apr 2001 01:08:28 +0200
Matthias Gall wrote:
>
> I guess I know what you mean, because I don't find a way to check for a
> NULL in my LUA script now.
>[...]
> Could you help me again please?
Just return a nil instead of a userdata(NULL). I.e.:
if (x)
lua_pushuserdata(x);
else
lua_pusnhil();
> > PS: Be careful when using userdata objects with the default tag...
>
> Why?
Because there's no way to check whether the userdata objects you get are
really from you or which type of pointer they hold.
Ciao, ET.