"If" condition

Top  Previous  Next

"If" condition allows selecting the data output depending on some condition of user-entered parameters.

Template:

{#ifcond (( expr1 ), ( expr2 ), ( expr3 ))#}
 

This expression evaluates and prints result of expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.

Example:

{#ifcond(( Number1 > Number2 ), ( Number1 + 10 ), ( Number2 ))#}

 

Let's say we have Number1 = 20 and Number2 = 5. Then Number1 is greater than Number2, expression Number1 > Number2 is TRUE and we print Number1 + 10, this equals 30.

Result:

30