You don't really need this in BlitzMAX any more, as the main usage of Object and Handle as I understood it was so a function could accept different (but related) types. With the
Extends keyword in BlitzMAX this isn't really necessary any more.
For example you would declare an abstract Animal type, and then create Cat and Dog subtypes. The function would ask for an Animal, and hence would accept Cat and Dog subtypes.
Here is the code though if you need B3D functionality exactly:
Type Monkey
Field id
End Type
m:Monkey = New Monkey
m.id=1212121
'Declare a Byte Ptr. If you wanted to avoid all of the casting, you could declare this as
'a Monkey Ptr, however if you want to replicate Blitz3D exactly you need a Byte Ptr.
'This can later be converted to any type of object pointer (not adviseable though)
Local pointerToM: Byte Ptr
'Get the address of m (varptr) and cast it from a Monkey Ptr to a Byte Ptr
pointerToM = Byte Ptr(Varptr(m))
'The Monkey Ptr( ) bit casts the Byte Pointer to a Monkey Pointer. The [0] bit at the
'end dereferences the pointer (ie. gets the value stored at that address)
q:Monkey=(Monkey Ptr(pointerToM))[0]
Print q.id