[Gambas-user] Replacing text values in a columnview

Benoit Minisini gambas at ...1...
Sat Jul 17 01:13:14 CEST 2004


On Saturday 17 July 2004 00:30, Gianni Piccini wrote:
> Probably this is a simply question, but I've not been able to find answer
> in the ml archive.
> I've a simple columnview, with 2 columns and some rows. For example, I have
> cities in first column, I would to set second with nation. First,
> columnview is in this mode
>
> |  Paris   |           |
> |  London  |           |
> |  Vaduz   |           |
>
> and I would set to
>
> |  Paris   |    fr     |
> |  London  |    uk     |
> |  Rome    |    it     |
>
> I imagine a loop like
>
> for j to columnview.count
> 	columnview[J][2] = FunctionForNames(columnview[J][1])
> next
>
> where FunctionForNames(name_of_the_city) retrieves the nation from the name
> of the city in the first column, but in my tries it doesn't work. I don't
> know the first value of the row, only the total number of rows...
> Should be simple if I set the key of the row to a progressive value?
>
>

If you don't care with the key of the row, you can use what you want. And you 
can use progressive numeric values of course. They are automatically 
converted to strings by the interpreter. I mean columnview[j][2] = ... is 
equivalent to columnview[cstr(j)][2] = ...

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list