[Gambas-user] Collection puzzle.

Benoît Minisini gambas at ...1...
Sat Sep 7 12:53:32 CEST 2013


Le 07/09/2013 12:48, Ron a écrit :
> Something eats my time here...
>
> I have a collection cCol which contains collections cCol2
> The keys of cCol2 are unknown because they come from a JSON.decode function.
>
> I can't seem to access those keys, anyone has an idea on how to print them?
>
> So in example below, the "1", "2", "6"
>
> It seems collection implementation misses some function/method or
> contains a bug.
>
> Public Sub Main()
>
>    Dim cCol As Collection
>    Dim cCol2 As Collection
>    Dim cVal As Collection
>
>    cCol2 = ["1": "one", "2": "two", "6": "six"]
>    cCol = ["A": cCol2, "B": cCol2, "C": cCol2]
>
>    For Each cVal In cCol
>      Print cVal.key
>    Next

--> You get the keys that way. What's the problem exactly?

-- 
Benoît Minisini




More information about the User mailing list