[Gambas-user] Arrays

Steven Lobbezoo steven at ...1652...
Thu Apr 19 22:11:17 CEST 2007


Hi,

I need to work with an array that i want to declare directly in my program. 
(outside from a sub or a function)
i did :
PUBLIC Docs AS Array[] = [["Terrain", "fb", "fiche_bien_terrain.odt"],
                          ["Batiment", "fb", "fiche_bien_batiment.odt"]]
which does not work, but illustrates the principe.
I need x times 3 vars that I can index simply like :

var = Docs["Terrain",2] which should put 'fiche_bien_terrain.odt" in my var.

With collections, i can only have 2 vars (if I understood it well), I need 3.
Of course, I could put everything in a db table, but that might be a bit 
overkill.
I could write a function that does the operation, but then again, it might be 
easy to just declare this in a certain way (that I could not find)

Any opinion on the best way to do this is most welcome

Steven





More information about the User mailing list