Translations:Templates/26/en

From meteoplug
Jump to: navigation, search

Conditional Expressions

Templates can work with simple conditional expressions. These expressions are not allowed to be used recursive and they must be used on top-level, i.e. not inside numerical expressions. Expressions must be built in a strict #if# ... #then# ... #else# ... #fi# manner.

  • #if# indicates start of the expression.
  • Between #if# and #then# a number is expected. Blanks will be ignored. If number is greater than 0.0 the expression is recognized as true otherwise as false.
  • In case of true expression, characters between #then# and #else# token will be used to replace the whole conditional expression in the template.
  • In case of false expression, characters between #else# and #fi# token will be used to replace the whole conditional expression in the template.

As conditional expressions will be evaluated at the very end, any template replacement operations or numerical computations will be done before.