[Gambas-user] ComboBox options from databse

Eduardo Huertas e.huertas at ...626...
Mon Sep 10 00:55:20 CEST 2007


Thanks for the quick answer. There must be something I am missing...

I have been playing with the idea you sent, but I get to the point
where I have to add the values to the ComboBox. As far as I have read,
the way to do it is...
SUB Add ( Item AS String [ , Index AS Integer ]

So, the method is wants a String, and will not accept a String[]
(array) as the first parameter.

What am I missing?

2007/9/9, ron <ronstk at ...239...>:
> I did put the id,item in a array and fill the combobox from this array.
>
> DIM id_item as object[]
> dim it as string[]
>
> for i = 0 to recordcount-1
>   it=new string[]
>   it[0]=result.field["id"]
>   it[1]=result.field['item"]
>   ad_item.add(it)
> next
>
> The index from the combobox is the entry in id_item array
> This way you can even use more as 2 fields to get from the array
>
> index is sequential and id can be with missing numbers this way.




More information about the User mailing list