[Gambas-user] how to fill combobox with specific index from a array matrix

PICCORO McKAY Lenz mckaygerhard at ...626...
Fri Jan 31 20:52:31 CET 2014


Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
From: Beno?t Minisini <gambas at ...1...>
> A 'MinDate' property could be a good idea...
> And a 'MaxDate' too, why not?
HEY BENOIT, NEVERMIND! FORGET IT AND MAKE THE EXAMPLES OF GB.WEB PLEASE!!!
(i still remenber that mail ok)

> From: Tobias Boege <taboege at ...626...>
>> does gambas provide collections in same way of java does?
> No, in Gambas, a Collection is a hash table and not a set (which is what
> Java seems to have). You do:
>
>   cCollection["key"] = value ' value is a Variant
ok, that ilustrate me how i can use it , does that bette rather than
cColection.add(value, "key")
but my problem are due my objects have two parts, id and descripcion,
i want to fill the combobox id with id of my tabls,and the respective
vlue of id comboboxeds (overrides with id from tables) with my values
of collection object


> do the following: create a String[] aResult or something. Then use the
> hresult["whatever_id"], converted to an Integer, as index:
>
>   aResult.Add(hresult["payload"], CInt(hresult["whatever_id"]))
>
umm this mees might work like the collection idea also
> Later, return that String[] as you do.
>
> Then, when filling the ComboBox, all the elements you didn't assign anything
> to (the missing "whatever_id"'s will be Null):
>
>   Dim aResult As String[] = GetTheResultArray()
>   Dim iInd As Integer
>
>   For iInd = 0 To aResult.Max
>     If Not aResult[iInd] Then Continue
>     myComboBox.Add(aResult[iInd], iInd)
>   Next
>
> Whether this works (your question below) or how it will look like if some
> indices in the ComboBox are missing, I don't know. Test it!
i will test now the code u paste me.. and reply later...


> Message: 8
> From: Tobias Boege <taboege at ...626...>
> This page documents inline collections (as the title says). Look at the
> Collection class documentation[0].
> [0] http://gambasdoc.org/help/comp/gb/collection?v3
thanks for the link! reading...




More information about the User mailing list