OK, thanks to all. The preprocessor macro feature in C++ was powerful...but
also could be very hard to debug. Its ok that C# doesn't do it, but I guess
its ok to mourn this feature's departure for a few hours...
Alain
"Jeff Johnson" <(E-Mail Removed)> wrote in message
news:iq8t18$k06$(E-Mail Removed)...
> "Alain Dekker" <(E-Mail Removed)> wrote in message
> news:iq8q2p$au4$(E-Mail Removed)...
>
>> In C++ you can do this:
>> #define MY_MAGIC_NUMBER 5
>> ...
>> if (nTheUserID == 5)
>> {
>> DoSomething();
>> }
>>
>> but I can't find how to do that in C#. The MSDN documentation appears to
>> suggest that this is not possible like it was in C/C++. Is that right? Is
>> there any way to use the preprocessor to define macros in C#?
>
> No. #define in C# is basically a Boolean. Either a symbol is defined or it
> isn't; it holds no value. And there are no preprocessor macros whatsoever.
>
|