in reply to I've never seen this syntax before

not == !

return !Execute($cmd); == return not Execute($cmd);

ie

if (Execute($cmd)) { return 0; } else { return 1; }

cLive ;-)

Replies are listed 'Best First'.
Re: Re: I've never seen this syntax before
by Anonymous Monk on Apr 05, 2001 at 00:41 UTC
    return 0; should be return "";
      It doesn't matter. I can return "0", 0, or "" for false. They are equivalent in a boolean context.

      cLive ;-)

        You're right, they are equivalent in a boolean context, but they are not equivalent. Your post implied that not and ! would return 0 and that is incorrect.

      Actually it is more subtle than even that. You can't replace !1 with 0 nor with "".

      0 is wrong because, in a string context, !1 is "" while 0 is "0".

      "" is wrong because, when warnings are turned on, 0+"" generates q(Argument "" isn't numeric) while 0+!1 is silent.

              - tye (but my friends call me "Tye")