hello,
i'm a newbie with C# and i'd like to Preprocessor macro like I do with my C compiler how can I do that is it possible
example
#define STEP1 0x01
#define STEP2 0x02
void Function(int Choice)
{
switch(Choice)
{
case STEP1 :
break;
case STEP2:
break;
}
}

C# and Preprocessor macro
Francis Shanahan
The C# preprocessor simply allow you to perform "conditional compiling". Using consts is much more effective than using symbol constants as it usually done in C world.
R0nda
const int STEP1 = 0x01;
const int STEP2 = 0x02;
(the rest is the same)
MCP_SS
example
#if debug
// Some code
#elif release
//Some other code
#else
//some other code
#endif
Wellnow
Sadly no... the preprocessor support in C# does not support this kind of value replacement as is supported in C and C++, instead in C# its support is pretty much limited to conditional compilation ala:
#define
MySymbolint DoSomething()
{
#if MySymbol
//Is included into build
return 10;
#else
//Is NOT included into build
return 20;
#endif
}