[Gambas-user] Removing / Modifying IsXXXX() functions in Gambas 3

richard terry rterry at ...1946...
Wed Nov 24 12:27:24 CET 2010


On Wednesday 24 November 2010 22:08:34 Benoît Minisini wrote:

Hi Benoit I use isDate() quite a lot, isNumber I think once

Regards
richard

> Hi,
> 
> I'm currently thinking about modifying/removing all IsXXXX() functions in
> Gambas 3.
> 
> They mainly test the datatype of their expression. So, either the datatype
>  is known at compile time, and there should be no need of testing it ;
>  either you are using a Variant, and you can use TypeOf() to get the
>  datatype of the value.
> 
> I will replace them by some functions that will test if a value can be
> converted safely from a string by using localization. This is what most
>  users expected from these functions.
> 
> For exemple, in french localization:
> 
> 	IsDate("13/2/20") -> True
> 	IsNumber("3,34") -> True
> 	IsInteger("3,34") -> False
> 	IsNumber("3.34") -> False
> 
> Internally, they will use Val() and see if the conversion works.
> 
> I will kept most of the name, so there will be a big incompatibility
>  between Gambas 2, current Gambas 3, and final Gambas 3.
> 
> What do you think about that?
> 
> Who is using the IsXXXX() functions, and in which context?
> 




More information about the User mailing list