More Group Sites
School Rankings
Jobless Net
Better Home
Enviro++


Help | Subscribe/Unsubscribe | Rules | Other Group Sites: Better Education | Better Education Forum
Welcome Guest Search | Active Topics | Members | Log In | Register

C# preprocessor Directives Options · View
hong
Posted: Friday, April 30, 2010 7:22:29 PM

Rank: Administration
Groups: Administration

Joined: 11/23/2008
Posts: 329
Points: 693
Location: Australia
C# preprocessor Directives
Code:
· #if
· #else
· #elif
· #endif
· #define
· #undef
· #warning
· #error
· #line
· #region
· #endregion

Code:
#define TEST

Code:
#if (TEST)

#else

#endif


Code:
#define TEST1
#define TEST2

Code:
#if (TEST1 && TEST2)

#elif (TEST1 && !TEST2)

#elif (!TEST1 && TEST2)

#else

#endif


Conditional compiler directive for debug mode
Code:
#define DEBUG

Code:
#if DEBUG

#endif
Sponsor
Posted: Friday, April 30, 2010 7:22:29 PM
hong
Posted: Thursday, August 26, 2010 1:00:59 PM

Rank: Administration
Groups: Administration

Joined: 11/23/2008
Posts: 329
Points: 693
Location: Australia
How to define project wide directives or pre-processors

Instead of defining directives in source code by class or file, you can define project wide directives in the project properties. In Visual Studio, right click on your project, then select Properties > Build > Conditional compilation symbols, enter whichever symbols you need (space delimited). Please note that DEBUG or TRACE can also be toggled with a checkbox.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 1.867 seconds.