Types. Help anyone?

BlitzMax Forums/BlitzMax Beginners Area/Types. Help anyone?

Dang, my example was crap, sry.

I wanted one identifier (variable) which should point to different objects which are instances of different user defined types (according the manual that terms should be right now;).

Anyway, that works but seems a little ugly:

Type A
Field x
End Type

Type B
Field y=10
Field z=20
End Type

Global obj1:A=New A
Global obj2:B=New B

Local currentobject:Byte Ptr=Byte Ptr(obj2)
Print currentobject[0]

I dont want to remember what index nr in currentobject stands for what field.


Maybe that aproach would be better?

Type A
Field x
End Type

Type B
Field y=10
Field z=20
End Type

Global obj1:A=New A
Global obj2:B=New B

global currentobject:object=obj2

"currentobject" now refers to obj2, but how to retreive any values/fields from it?