Anvil | Smiths Smiths | Register Register | Login Login |
Search:
Show links Show tools Show tree | Previous document Next document | njet.org > Anvil > Documentation > Language reference > Templates > Tags > <if>, <else> and <elseif>

<if>

  <if (expr|true|false)="exprcondition" >
    statement *
  [ <else>
    statement * ]
  </if>

  <if (expr|true|false)="exprcondition-1" >
    statement *
  <elseif expr="exprcondition-2" >
    statement *
    ...
  <elseif (expr|true|false)="exprcondition-N" >
    statement *
  [ <else>
    statement * ]
  </if>

A ``if´´ tag allows conditional execution of statement of conditional choice of two statements, executing one or the other but not both. See if statement.

A ``if .. elseif´´ tag allows conditional execution of one of chained if statements. Executing the first statement whose condition evalutes to "true".

Attributes:

expr
Condition expression.
true
Condition expression, same as expr.
false
Negated condition expression. I.e. first group of statements is executed iff the condition yields "false", otherwise the second group (if any) is executed.

Note: conditions are mutually exclusive.

See also  | Tags  | Statement tags
Contributes notes:
Add a note
What's new | Anvil