[Gambas-user] Fwd: Re: Removing / Modifying IsXXXX() functions in Gambas3
Benoît Minisini
gambas at ...1...
Wed Nov 24 16:25:04 CET 2010
On Wed, 24 Nov 2010 11:53:20 pm you wrote:
> > 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.
>
> Then you are using IsNumber() the wrong way: in your code, vItem is a
> string (I guess), and so IsNumber(vItem) will always return FALSE.
>
> You used IsNumber() as if it would tell you if a string can be converted
> to a number, which it does not at the moment! And which is exactly what
> I want to change!
Arrrrrggh, yer right again. After calming down I checked.
IF IsNumber(Val(vItem)) THEN RETURN Val(vItem)
Sorry, I just get the panics over "my precious code" :-)
--
best regards
Bruce Bruen
More information about the User
mailing list