Hi all,
My question is not about a specific B4A feature, but a programming question in general. But since I need it in a B4A-app, this seems to be the right place to ask.
I have a table with 10 columns and about 135 rows (and expanding slowly).
In the first column of each row a text (string) exists.
I would like to load a spinner with the different values in column 0, but if a value already exists in the spinner it should not be added again.
I can go over all rows in the table and add column 0 to the spinner, but that adds everything in Column 0 to the spinner :
I need some way to skip adding a value when it already exists in the spinner.
:sign0163:
Later I might want to sort the Spinner-entries on the number of occurences or just alphabetically, but for now that's not necessary.
My question is not about a specific B4A feature, but a programming question in general. But since I need it in a B4A-app, this seems to be the right place to ask.
I have a table with 10 columns and about 135 rows (and expanding slowly).
In the first column of each row a text (string) exists.
I would like to load a spinner with the different values in column 0, but if a value already exists in the spinner it should not be added again.
I can go over all rows in the table and add column 0 to the spinner, but that adds everything in Column 0 to the spinner :
B4X:
For i = 0 To Tabel.LastEntry 'Go over all entries in Table called Tabel.
spnPlaatsInvoer.Add(Tabel.GetValue(0,i)) 'add it to the spinner
Next
I need some way to skip adding a value when it already exists in the spinner.
:sign0163:
Later I might want to sort the Spinner-entries on the number of occurences or just alphabetically, but for now that's not necessary.