The Condition object is a decision-making device that works like a railroad switch. It compares variables and redirects the flow of execution depending on the results of the comparison. At the heart of the Condition object is a logical expression that compares values contained in variables, or evaluated from other expressions. Logical expressions always evaluate to one of two values: YES or NO.
The following examples illustrate the concept of logical expressions:
| Logical expression | Evaluates to | |
| Amount > 100.0 | YES if Amount is greater than 100.0, otherwise NO | |
| Quantity != 0 | YES if Quantity is not zero; otherwise NO | |
| Debit + Credit < OldNet | YES if sum of Debit and Credit is less than OldNet, otherwise NO. | |
| Price < 5.0 AND Quantity > 3 | YES if both conditions evaluate to YES: Price is less than 5.0 and | |
| Quantity is greater than 3. If any of the two conditions evaluate to NO, | ||
| the final result is NO. | ||
| Discount > 0 OR Amount <= 1.0 | YES if any of the two conditions evaluate to YES: Discount is greater | |
| than zero, or Amount is less than or equal to 1.0. If both conditions | ||
| evaluate to NO, the final result is NO. |
Go to:
Index
Table of Contents