ADELIA |
VADELIA |
SADELIA |
WADELIA |
MADELIA |
(I/B) |
(I/B) (C/S) |
(B) (S) |
(I/B) (C/S) |
(I) (C/S) |
Section for use
All
Syntax
IF Condition
Description
This instruction evaluates a condition.
This evaluation can be composed of several conditions.
The logical operators are: =, >, <, >=, <=, <>, START_WITH, CONTAINS, BETWEEN, EXISTS, DOES_NOT_EXIST, NOT, INSTANCE_OF.
Additionally, with VADELIA, SADELIA and WADELIA programs, you can use arithmetic or concatenation expressions in the left and right factors of logical operators (arithmetic operators take precedence over logical operators).
If the expressed condition Condition does not apply, control goes to the instruction following the associated END instruction or, if the case arises, to the instruction following the associated ELSE or ELSE_IF instruction.
If the expressed condition applies, all the instructions which follow will be executed until the associated END instruction is reached or, if the case arises, until the associated ELSE or ELSE_IF instruction is reached.
Every IF instruction must have an associated END instruction.
Note: You can nest up to 100 levels of IF instructions.
Example
IF Z_PAYMENT_CODE <> *BLANK
CHAIN PAYMENTS
*
IF PAYMENTS DOES_NOT_EXIST
PREPARE_MSG 0090 Z_PAYMENT_CODE
ANOMALY
ELSE
*
IF *LOCKED = '1'
PREPARE_MSG 0002 Z_PAYMENT_CODE
ANOMALY
END
END
END
*
IF *F13 AND ( W_MODE <> 'D' OR ACTION_CODE = 'DELETE' )
PROCESS_PROC SBRDEL
END
*
IF Z_COUNTRY_CODE START_WITH '?'
CALL SELECT_COUNTRY Z_COUNTRY_CODE
END
*
IF MONTH BETWEEN 4;6
QUARTER_N = 2
END
*
IF iObject INSTANCE_OF CPERSON
END