[Gambas-user] Collections

Charlie Reinl Karl.Reinl at ...2345...
Fri Jan 15 21:39:14 CET 2010


Am Freitag, den 15.01.2010, 16:04 -0300 schrieb Pino Zollo:
> DIM Dict AS NEW Collection
> DIM Element AS String
> 
> Dict["Blue"] = 3
> Dict["Red"] = 1
> Dict["Green"] = 2
> 
> FOR EACH Element IN Dict
>   PRINT Element;
> NEXT
> 

Salut,

did you ever more then run that code ? debug ? or looked whats a
Collection ?

OK, "Blue","Red" and "Green" are the KEY for the Collection Element,
and so they declared and asigned.

try that!

PUBLIC SUB Main()                     
   DIM Dict AS NEW Collection
   DIM Element AS String
   
   Dict["Blue"] = 3
   Dict["Red"] = 1
   Dict["Green"] = 2
   
   FOR EACH Element IN Dict
     PRINT Element
     PRINT Dict.Key
   NEXT
END 

 
-- 
Charlie





More information about the User mailing list