lua-users home
lua-l archive

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


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.