Re: CriticalAlert
Re: CriticalAlert
- Subject: Re: CriticalAlert
- From: "John C. Randolph" <email@hidden>
- Date: Thu, 20 Dec 2001 10:06:50 -0800
On Thursday, December 20, 2001, at 08:52 AM, Diggory Laycock wrote:
>
> You want (alertResult == NSAlertAlternateReturn), etc. That
>
> is, "==", not "=".
>
>
Thanks - I was being stupid!
Not really. You just got bitten by one of C's common "typos
that compile just fine" problems. It's something you can look
at directly, and not see.
In most of my C code, I have the macros:
#define is ==
#define or ||
#define and &&
So (for example) I never assign a value when I mean to test for
equivalence, or do a bitwise "and" when I meant to do a logical
"and".
e.g:
if (foo is bar)
;
-jcr
"For every complex problem there is an answer that is clear,
simple, and wrong." -- H L Mencken