Hi - I've been iterating through type lists in my programs - to display images and do collision checks. However I now need to do some more specific stuff, and I am struggling. Here's an example of what I want to do.
Type carrot
Field variety:String
EndType
carrot_list:TList =New TList
'--------- Add Carrots to list ---------------------
c:carrot=New carrot
c.variety="Orange"
carrot_list.addlast c
c:carrot=New carrot
c.variety="Black"
carrot_list.addlast c
'---------get first carrot in list
c:carrot=carrot(carrot_list.first)
Basically I can't work out how to get the first object in the list. This code fails on the final line ( I get an errror). Evidently I need to do some casting, but I doing it wrong. Help Please!
Rico
|