Conditionally executes a group of statements, depending on the value of an expression.
@if ( condition1 ) text1 [@elif ( condition2 ) text2] [@else text3] @end
When you write an @if statement, you do not have to place each clause on a separate line. You can use multiple @elif clauses. However, all @elif clauses must come before an @else clause.
You commonly use the @if statement to determine which text among several options should be used for text output. For example:
alert(@if (
@_win32)
"using Windows NT or Windows 95"@else
"using Windows 3.1"@end
)
Conditional Compilation | Conditional Compilation Variables | @cc_on Statement | @set Statement