#define's are basically a simple find and replace, so if you do:

#define IsDemo NO;

and then do:

if (IsDemo) { ... }

It's going to become:

if (NO;) { ... }

See the problem?  You've got a semicolon in there.  Generally, you don't end a 
#define with a semicolon unless you want a semicolon in the place where the 
#define will be used.

Dave

On Feb 26, 2010, at 11:22 PM, Adam Gerson wrote:

> I have the following constant set up. I have tried all three of these
> variations and none of them work in an if statement in cocoa. I get
> error: expected `)' before ';' token
> 
> #define IsDemo NO;
> #define IsDemo false;
> #define IsDemo 0;
> 
> 
> if (IsDemo) {
>  bla...
> }
> 
> Same problem, when I try:
> #define FreeUpdateDaysAllowed 180;
> if (daysSoFar > FreeUpdateDaysAllowed)
> 
> 
> What am I doing wrong? Whats the right way to have a bool or int constant?
> 
> Thanks,
> Adam
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com
> 
> This email sent to davedel...@me.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to