hi guys!
My query is regarding TList. Is there any way to cast a object returned from Tlist to its original object?
I do this:
1. Add a Type of TBattleCruiser to a Tlist.
2. Do some stuff
3. Then later on i want to return a object of type TBattleCruiser such as
But, that doesnt work coz BlitzMax complains at compiletime that TheTlist.Last() would return Object. Is there any way to cast Object to TBattleCruiser?
I know the C# syntax would be:
How do i get the same result as C#, but with BlitzMax?
TIA!
My query is regarding TList. Is there any way to cast a object returned from Tlist to its original object?
I do this:
1. Add a Type of TBattleCruiser to a Tlist.
'// implicitly here MyBattleCruiser is a Type already in existance in code. TheTlist:TList = new TList TheTlist.AddLast(MyBattleCruiser)
2. Do some stuff
3. Then later on i want to return a object of type TBattleCruiser such as
MyBattleCruiser = TheTlist.Last()
But, that doesnt work coz BlitzMax complains at compiletime that TheTlist.Last() would return Object. Is there any way to cast Object to TBattleCruiser?
I know the C# syntax would be:
MyBattleCruiser = (TBattleCruiser)objTheTlist.Last()
How do i get the same result as C#, but with BlitzMax?
TIA!