Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Something like .h files in VFP
Message
From
05/08/2004 10:37:09
 
 
To
05/08/2004 09:29:52
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00930980
Message ID:
00931017
Views:
22
Alvaro,

In addition to what others have said you can still define preprocessor constants in C# using any of the following, some of which do not exist in C/C++.
#if 
#else 
#elif 
#endif 
#define 
#undef 
#warning 
#error 
#line 
#region 
#endregion 
The C# compiler does not have a seperate preprocessor as in C/C++ so you don't have a #include available.

It also worth pointing out that you can have conditionally called void methods using the Conditional attribute.
#define DEBUG

using System;
using System.Diagnostics;

class SampleClass
{
   [Conditional("DEBUG")]
   public static void ConditionallyIncluded() {
      Console.WriteLine("Hello Zaphod!");
   }
}
Regards
Neil
Previous
Reply
Map
View

Click here to load this message in the networking platform