Advanced IF Syntax
IF [NOT] where_clause[ {AND|OR} where_clause[...] ]
END_IF
where_clause is exactly as before, except that if you include it in brackets, you can put NOT in front to negate just that clause. Note that if you include a NOT right at the beginning of all clauses without brackets, it will negate the whole expression, not just the first clause - this is for backwards compatibility. To negate any clause individually, always enclose it in brackets to be safe.
NOT, and by using brackets you can alter priorities.
By default, OR will be evaluated before AND. It is strongly recommended to put brackets around combinations to show the intended priority clearly. If you mix the comma and AND / OR / NOT (not recommended), everything between each comma will be treated as if it were inside brackets.
Example:
(Statement split over multiple physical lines for clarity only)
This condition will now fire if the congregation is your local one and the brother is not the one named. It will also trigger if the talk number is 161 or higher (not less than or equal to 160).
IF ("Congregation" IS "$LocalCong" AND “Brother”
ISNOT “$strThisBrother”)
OR (NOT “Talk Number” ISLESSOREQUAL “160”)
(commands go inside IF)
END_IF