[Gambas-user] ComboBox.Add method with index, fails

Benoit Minisini gambas at ...1...
Thu May 15 22:00:44 CEST 2008


On jeudi 15 mai 2008, Mike Brett wrote:
> The syntax for this is given in the Help as
>
> SUB Add ( Item AS String [ , Index AS Integer ] )
>
> When I try simply
> ComboBox.Add("some text")
> there are no errors.
>
> Whenever I try to add an index, such as
> ComboBox.Add("some text", 127)
> or even
> ComboBox.Add("some text", CInt(127))
>
> I get
> QComboBox::insertItem: (unnamed) Index 127 out of range
> QComboBox::setCurrentItem: (unnamed) Index 0 out of range
>
> What am I doing wrong please?
>
> Thanks.
>
> - Mike Brett - (gambas 2.6.0 on Fedora 8)
>

Maybe 127 is greater or equal to the number of items in the ComboBox?

-- 
Benoit Minisini




More information about the User mailing list