Syntax
comparison_expressions ::= ( 'eq:' | 'gt:' | 'lt:' | 'in:' ) expression expression [ expression ]*
Description
The available comparison expressions are:
eq:-> checks if 2 or more integers are equals. If the values are not numbers, it checks if they are equals.gt:-> checks if a number is greater than another.lt:-> checks if a number is lower than another.in:-> checks if a value is in a list of expressions.
All operators uses lazy evaluation. All expressions support 2 or more operators. Parenthesis can be used.
Differences with ZPT
This expressions does not exist in ZPT.
Examples
Some examples in data-condition:
<p data-condition="eq: assets liabilities anObject">
true if assets, liabilities and anObject are all equals
</p>
<p data-condition="gt: 10 ( +: children pets )">
true if 10 > ( children + pets)
</p>
<p data-condition="lt: 10 ( +: children pets )">
true if 10 < ( children + pets)
</p>
<p data-condition="in: value 'option1' 'option2' 'option3'">
true if value is 'option1', 'option2' or 'option3'
</p>
<p data-condition="in: value array">
true if value is an item of array
</p>
<p data-condition="in: value 'option1' 'option2' array">
true if value is 'option1', 'option2' or an item of array
</p>