Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Something like .h files in VFP
Message
De
05/08/2004 10:37:09
 
 
À
05/08/2004 09:29:52
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00930980
Message ID:
00931017
Vues:
24
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform