Csharp/CSharp Tutorial/Preprocessing Directives/elif — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 12:17, 26 мая 2010
Demonstrate #elif
- The #else directive establishes an alternative if #if fails.
- #else marks both the end of the #if block and the beginning of the #else block.
- The #elif directive means "else if".
- The #elif directive establishes an if-else-if chain for multiple compilation options.
- #elif is followed by a symbol expression.
- There can be only one #endif associated with any #if.
- If the expression is true, that block of code is compiled, and no other #elif expressions are tested.
The general form for #elif is
#if symbol-expression
statement sequence
#elif symbol-expression
statement sequence
#elif symbol-expression
statement sequence
#elif symbol-expression
statement sequence
#elif symbol-expression
.
.
.
#endif