On Wed, 24 Nov 2010 09:38:34 pm Benoît Minisini wrote:
> 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?

Benoît,

MAJOR PANIC!  I use IsNumber extensively to do quick checks on field parsing 
across heterogeneous databases.  Using the 80-20 rule I can parse text fields 
for junk appendices to an expected numeric. 
Code such as 

        vItem=split(result!note," ",NULL,TRUE)[0]
       IF IsNumber(vItem) THEN RETURN Val(vItem)
'     else begin parsing diabolical note structure
    .....

abounds.

Please reconsider this.

-- 
best regards
Bruce Bruen

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to