[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How does lua_touserdata work? Userdata also..
- From: RLake@...
- Date: Thu, 27 Mar 2003 17:34:29 -0500
> called like:
> Poke("0100579C", 5, 4)
> in the script ( 5 being the value here)
> It's supposed to be a void * because I want to cast it to BYTE,
> WORD, or DWORD depending on the size parameter.
> However.. value always comes out NULL.
> What am I doing wrong?
5 isn't a userdata. It's a number. You should access it as a number. (You
might want to supply it as a hexstring, too, though.)
Userdata's are objects created within C, opaque to Lua. You cannot create a
userdata in Lua.
touserdata returns null if the indicated object is not a userdata, which it
Hope that helps.