Expression
The formula expression defines the calculation to be executed.
The fields displayed in the Formula File correspond to:
| • | Expression |
When pressing Enter in this field, system displays the Standard Selection that must define the type of calculation to be executed:
| • | Clear |
| • | 1st Expression and 2nd Expression |
When pressing Enter in one of these fields, the system displays the Formula Register for Procedures screen where you must select the type of factor to be considered in the formula, among the options:
| • | Roles |
| • | Formulas |
| • | Constant |
These two fields complement each other. A mathematic operation (x + y) can be carried out, or a comparison (x >= y). In the monthly salary formula displayed in the example these fields have the following content:
| • | Seq. 0010: |
In the 1st Expression, the field of file SRA->RA_TIPOPGT indicates the employee's payment type.
In the 2nd Expression, constant M indicates Monthly-Paid-Worker category.
Field Op.2 must establish operation between both. In this example, logical operator \"==\" (double equal sign) indicates that the formula line checks if the employee's payment equals the monthly-paid worker.
If the expression is true, notice that there is a continuation (.AND.) for the condition (.CON.).
| • | Seq. 0020: |
In 1st Expression, field of file SRA->RA_CATFUNC indicates the employee's category.
In 2nd Expression, constant M*C*P*A*E indicates categories: Monthly-paid-Worker, Commissioned, Pro-Labore, Self-Employee and Intern, respectively.
Field Op.2 must establish operation between both. In this example, logical operator $ (contained) indicates that the formula line is verifying if the employee's category is contained in one of the letters mentioned above.
If this expression is true, the condition (.CON.) is finalized (.END.) so that Seq. 0030 is executed and the formula is finalized.
| • | Seq. 0030: |
In this sequence, if both conditions of 1st and 2nd Seq are satisfied, the formula is finalized. The content of resulted field, in the example, is the field of Employees file SRA->RA_SALARIO. When executing this line, the formula result is the employee's salary value, R$ 1,500.00 for example. This value is automatically transported for the mnemonic informed in return field: SALMES.
That way, the formula continues to verify and execute the conditions if they are accomplished The formula is finalized if one of the conditions is accomplished or, if all conditions are tested and none of them are accomplished. That way the mnemonic return must contain a value, the employee's salary.
The screen helping the completion of 1st and 2nd expression is the same one displayed in the result field. |