[Gambas-user] type mismatch: wanted integer, got string instead

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue Aug 25 08:40:10 CEST 2009


Why don't you just convert the characters into numbers before converting 
the values?

> Unfortunately, the possible values are more then that, it's just a
> sample.
> The values are amount of rainfall data, so it has numbers (0 to 400)
> also with floating number 0.5, 1.7, and so on.
> The field of old data on the database was set with string type, which
> "x" represent as a value less then 0.5, "-" represent as no rain, and
> NULL represent as no data.

For example, you could use Replace to change "x" into 0.4, "-" into 0 
and NULL (search for chr$(0)...) into 0.3 or whatever. So everything is 
a value now, and the converting functions will be happy.

Regards

Rolf





More information about the User mailing list