here is another example:
Graphics 640,480 Type Tveggie Field name:String Field freshness:Int End Type Type Tpot Field name:String Field x:Int Field y:Int Field PotContents:Tveggie[10] Field MAXVEGGIES:Int = 10 Field Veggiecount:Int Method AddVeggie(vname:String="Generic Vegetable",fresh:Int=100) Veggiecount:+1 PotContents[Veggiecount].name = vname PotContents[Veggiecount].freshness = fresh End Method Method Display() SetColor 255,0,0 DrawText name,x,y SetColor 255,255,0 For Local t:Int = 0 To MAXVEGGIES - 1 DrawText PotContents[t].name,x,y+(t*TextHeight("H")) Next End Method Function create:Tpot(pname:String,xp,yp) Local temp:Tpot = New Tpot temp.name = pname temp.x = xp temp.y = yp For Local t:Int = 0 To temp.MAXVEGGIES - 1 temp.PotContents[t] = New Tveggie Next Return temp End Function End Type Local Dinner:Tpot = Tpot.create("Bill's Stew",100,100) Dinner.AddVeggie("Carrot",5) Dinner.AddVeggie("Beet",80) Dinner.AddVeggie("Lettuce",5) Dinner.AddVeggie("Corn",80) Repeat Dinner.display() Flip Cls Until KeyDown(KEY_ESCAPE)