<if cond="">

A conditional statement used to determine what the application executes on the basis of the evaluation of one or more variables.

The value in cond="" must be an expression containing the following three elements: 1) a value, variable or function; 2) an operator; and 3) another value, variable or function.

There must be no spaces in the expression other than spaces that may be present in a text string value.

All variables used in the conditional statement must have been defined (using <assign name=""/> or <get>) before the conditional statement, either above the conditional statement in the same node, in a previous node, or in <settings> (using <assign name="" expr=""/>). If they are undefined, they will cause an error. Likewise, if an existing variable is assigned a new value using <assign name="" expr=""/>, this must be done before the conditional statement if the new value is to be evaluated.

Constants in conditional statements must be placed in single quotes; variables must not.

Allowed operators are:
== is equal to*
!= is not equal to
> is greater than
< is less than
>= is greater than or equal to
<= is less than or equal to
* Note that two equal signs are used in evaluation rather than assignment.

Child of: <node name=""> or any multi-line tag at any level within <node name="">
Parent of: Nothing


<if cond="user_visits=='1'">
<elseif cond="user_visits=='2'"/>

Working example: Search for <if cond="">...<elseif cond=""/>...<else/>...</if> in the file trivia_demo.xml.