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

Fabien Bodard gambas.fr at ...626...
Fri Aug 28 11:23:59 CEST 2009


try this


IF NOT sRain THEN
 IF InStr(LCase(sRain), "x") > 0 OR InStr(sRain, "-") > 0 THEN
   fRain=0
 ELSE
   TRY fRain = CFloat(sRain)
   IF ERROR THEN fRain=-1  'Not a Valid Number
 ENDIF
ELSE
 fRain=-1
ENDIF




More information about the User mailing list