Show/Hide Toolbars

XSharp

Purpose

When the X# compiler encounters an #ifndef directive, followed eventually by an #endif directive, it will compile the code between the directives only if the specified symbol is NOT defined.

The #ifndef statement in X# is Boolean and only tests whether the symbol has been defined or not. For example,

 

// DEBUG may be defined from the command line
// ...
#if DEBUG
   Console.WriteLine("Debug version");
#else
   Console.WriteLine("Release version");
#endif

Note

when /vo8 is active then any symbol defined with FALSE or a 0 numeric value will also be seen as "undefined".