Condition

Including one Condition
Condition is an expression that will be evaluated for the execution of one or several actions, if the result of expression is true.
Several conditions can be informed and connected to operators and always finalized with the operator
A condition can have other conditions as sub-items, bonds (while), joining them with operators .AND. or .OR. The last condition sub-item to be executed must be with operator .END.
The field corresponding to condition can be enabled by pressing [F5], and it is classified in the formula structure with caption
.
Example 1:
The formula must return the employee's monthly salary.
| • | If the type of payment of employee is monthly (M) and the category is monthly-paid worker (M), the return is the registered salary. |
| • | If the type of payment of the employee is weekly (S) and the category is weekly-paid worker (S) the return is the registered salary divided by 7 and multiplied by 30. |
Example 2:
Type |
Result |
Operator 1 |
1st Expression |
Operator 2 |
2nd Expression |
Operator 3 |
Condition |
|
|
cSitFolh |
== |
\" \" |
.END. |
Condition |
|
|
SRA->RA_TIPOPGT |
== |
M |
.AND. |
Condition |
|
|
SRA->RA_CATFUNC |
== |
M |
.END. |
Execution |
-SalMes |
:= |
SRA->RA_SALARIO |
|
|
.END. |
Condition |
|
|
SRA->RA_TIPOPGT |
== |
S |
.AND. |
Condition |
|
|
SRA->RA_CATFUNC |
== |
S |
.END. |
Execution |
-SalMes |
:= |
SRA->RA_SALARIO/7 |
* |
30 |
.END. |
Execution |
dbSkip() |
|
|
|
|
.END. |