Re: request for change of boolean

new topic     » goto parent     » topic index » view thread      » older message » newer message

Kat wrote:
> 
> Is it possible to change how boolean expressions are evaluated such that only
> values greater than 0 pass this test? :
> 
> }}}
<eucode>
> readfile = open(flagfilename,"r")
> if readfile then
> -- it's there, process it
> end if
> </eucode>
{{{

> 
> Currently, if readfile = -1 , it evaluates to TRUE, when in fact the readfile
> was not opened.

I agree with this. I have counted on positive values being TRUE and
values <= 0 as being FALSE. It has bit me before. Yes, it's simple to
fix, but if we are treating the value as boolean...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu