[Gambas-user] Inbuilt function to check if a string contains a valid number
gambas at ...1...
Tue Jul 26 14:31:39 CEST 2011
> Is there an inbuilt function in Gambas 2 (2.21) to check if a string
> contains a valid number?
> Vikram Nair
No, but you can do that:
DIM MyNumber AS Float
TRY MyNumber = Val(MyString)
IF ERROR THEN PRINT "Not a valid number"
In Gambas3, IsNumber() does what you want. But not in Gambas 2, beware!
More information about the User