lua-users home
lua-l archive

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


> 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
isn't.

Hope that helps.

Rici