object handle

BlitzMax Forums/BlitzMax Programming/object handle

{cYan|de}(Posted 2004) [#1]
might be missing something in the docs here, how would u do object and handle in max? (probally changed its name but same thing)


AntonyWells(Posted 2004) [#2]
All types are derived from the object class/type.

So you can do this,

Type MyType
Field Test
End Type

A:MyType = New MyType

Obj:Object=Object( A )

I.e you can make any type an object and pass it around. And transform it into any other class below it in the class tree.


Hotcakes(Posted 2004) [#3]
Plus we have proper pointers now, so Handle and Object are irrelevant anyway.


Beaker(Posted 2004) [#4]
How would you cast an Int or Object back to a Type tho?


Dreamora(Posted 2004) [#5]
Type( ... ) -> cast to type
this is only allowed within the same derivation tree.


flying willy(Posted 2004) [#6]
interesting.

Local rememberme = a

should work also.