Using Project-Level Custom Constants

Problem
You want to know the best way to define and use compilation constants.

Solution
Avoid using #const directives; instead, favor project-level custom constants.

Comments
Custom constants can be entered on the Build tab of the Project Properties page. Use the Conditional compilation symbols field and specify the value in ALL CAPS.

// Avoid
#if DEBUG
Log.AllErrors();
#endif

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s