Name
ToUserData -- convert number to a userdata pointer (V6.0)
Synopsis
ptr = ToUserData(val)
Function
This function can be used to turn an arbitrary number into a variable of type #LIGHTUSERDATA which is used to store memory pointers. You could then pass this variable to a function which expects a #LIGHTUSERDATA parameter.

Note that this function is dangerous and should only be used by people who know what they are doing. Using pointers that point to unallocated address space can easily crash your script.

To convert a pointer of type #LIGHTUSERDATA back into a number, use the ToNumber() function. See ToNumber for details.

Inputs
val
numeric value to be converted into a #LIGHTUSERDATA pointer
Results
ptr
pointer of type #LIGHTUSERDATA

Show TOC