[Gambas-user] Why is val() so roundabout?

Benoit Minisini gambas at ...1...
Wed Jun 22 17:11:11 CEST 2005


On Wednesday 22 June 2005 16:34, Eilert wrote:
> lordheavy schrieb:
> >>So, is there a reason for this behaviour (maybe a question directly
> >>going to Benoit - hey, what about your finger?), or is it a bug?
> >>
> >>Rolf
> >
> > Perhaps becouse val("0") = 0 and val("something") <> 0 because it can't
> > be eVALuate ? so it's NULL !
> >
> > I guess it's logical. Don't you ?
> >
> > Regards,
>
> Yes, it is logical, but not very practical. In practice I just want to
> know if there is a value, and if there is some character it cannot read
> it's just 0. Well, there might be cases where an error might be
> practical I have to admit, but in 99 % of my cases it isn't.
>
> Rolf
>

I'm surprised. I find the way I did far more logical AND practical!

If Val() returns 0 when it can't interpret its argument, how do you make the 
difference between Val("0") and Val("anything") ?

I prefer that the functions behave logically rather than being pratical for 
one specific case of one programmer :-)

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list