[Gambas-user] ComboBox.Clean basic question

Hans-Martin Bundeshund bundeshund at ...467...
Sat May 29 15:39:03 CEST 2004


Hello,

this is my first posting to this group and I guess I have a very simple 
question for you.

I try to write a little application with gambas and mysql. Now I run into 
trouble:

I have a ComboBox where the user can select entries which I generated in the  
_new()-function using a sql-select-*-statement for all entries in this table. 
So far so good. All entries are selectable in the combobox.

I have a TextBox, where the user can enter a serch text. With this 
text-string, I redo the sql-select for the entries, limiting the result by 
his entered search query. 

And now, I want to clear all old entries in the combobox, then add the new 
entries from the reselected sql-query. But how?

When I use 'ComboBox.clear' the programm crashes with returncode(-1).
So I tried to count from '0' to 'combobox.count' and delete each entry with 
'combobox.remove'. This is nearly usable, but two old entries still survive 
this loop! Only when I repeat this loop three times, the combobox empty.

 What do I wrong? How to clear all combobox entries?

Best regards,
HM




More information about the User mailing list