Show/Hide Toolbars

XSharp

Purpose

#else lets you create a compound conditional directive, so that, if the expression in the preceding #ifdef directive or #ifndef directive does not evaluate to true, the compiler will evaluate all code between #else and the subsequent #endif.

For example, the following code will show the string "Debug Version" if the symbol DEBUG is defined on the command line, else it will show the text "Release Version"

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