Re: Existe En Gambas Los Arrays De Clave Igual Valor
Si, existe, es la clase Collection, donde el indice es texto y los valores son variant.
Saludos.
Gracias creo que esto es lo que yo buscaba, incluso en
gambas existe un ejemplo más o menos como yo quería.
Public Sub Main()
Dim cAbbr2Weekday As Collection = ["mo": "Monday", "tu": "Tuesday", "we": "Wednesday", "th": "Thursday", "fr": "Friday", "sa": "Saturday", "su": "Sunday"]
Dim cCopy As Collection
Dim sAbbr As String
' To access the data
Print cAbbr2Weekday["fr"]
' Print mapping key to value
For Each sAbbr In cAbbr2Weekday
Print cAbbr2Weekday.Key & " --> " & sAbbr
Next
' Lenght/Count return both 7
Print cAbbr2Weekday.Count
Print cAbbr2Weekday.Length
' Add element and remove it again
cAbbr2Weekday.Add("sat", "Saturday")
cAbbr2Weekday.Remove("sat")
' Test if a key is present
Print cAbbr2Weekday.Exist("we")
' Make a copy and clear the original collection
cCopy = cAbbr2Weekday.Copy()
cAbbr2Weekday.Clear()
End