Statement
Conditionally executes a set of statements based on the value of an expression.
@if (
condition1
)
text1
[@elif (
condition2
)
text2]
[@else
text3]
@end
Parameters
Condition1, Condition2
Options available. An expression that can be cast to a Boolean expression .
Text1
Options available. The text to parse when condition1 is true .
Text2
Options available. The text to parse when Condition1 is false and condition2 is true .
Text3
Options available. The text to parse when both condition1 and condition2 are false .
Description
When writing @if statements, you do not have to place each clause in a different row. You can use multiple @elif clauses. However, all @elif clauses must appear before the @else clause.
@if statements are typically used to determine which of several options should be used for text output. For example:
alert(@if (@_win32)@else@end)
Requirements
Version 3
Please see
Conditional Compilation | conditional Compilation Variables | @cc_on Statement | @set Statement