Re: [Windows] Associate file extensions with a program

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

Pete Lomax wrote:

[snip]
> >   return 0                                -- success
> PS: Please do not return False to indicate success.

He didn't. He returned *zero*. I'm sure you are not saying that every
0 is also a 'false', just as every 1 is not a 'true'. Just because
RDS chose to represent a falsehood with integer zero, doesn't mean that
every use of zero implies a falsehood, nor every use of a one implies a 
truth.

Truth and Falsehood are not numbers. RDS represents these concepts by
using numbers, but that is a mere convenience. 

In Juergen's routine, 0 *represents* a success not a falsehood. 

One might argue that using zero for success makes reading code a problem
if you write code thus ...

    if not SomeFunc() then
       -- Success!
       DoSuccess()
    else
       -- Failure
       DoFailed()
    end if

I maintain that a 'better' way to write such code is more like ...

   constant SUCCESS = 0
   if SomeFunc() = SUCCESS then
     DoSuccess()
   else
     Do Failed()
   end if

-- 
Derek Parnell
Melbourne, Australia

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

Search



Quick Links

User menu

Not signed in.

Misc Menu