How to store reference of an object in an array?
BlitzMax Forums/BlitzMax Beginners Area/How to store reference of an object in an array?
| ||
Could you help me with this issue, please:Global myArray:TLink[10] Type myType1 Field x:Int End Type Type myType2 Field x:Int End Type my1:myType1 = New myType1 my2:myType2 = New myType2 myArray[1] = ??? reference To my1 ??? myArray[2] = ??? reference To my2 ??? I need to store a reference to different objects in a TLink-Array (the objects differ, so array:myType is not possible). Is this possible somehow? |
| ||
How about :Global myArray:Object[10] or.. Global myArray:BaseType[10] Type BaseType End Type Type myType1 Extends BaseType Field x:Int End Type Type myType2 Extends BaseType Field x:Int End Type ? |
| ||
Yes, thanks Brucey! That's it. |