ADELIA |
VADELIA |
SADELIA |
WADELIA |
EADELIA |
(I/B) |
(I/B) (C/S) |
(B) (S) |
(I/B) (C/S) |
(B) (C/S) |
Section for use
All
Syntax
AlphaVarId = AlphaExpression
AlphaVarId = NumVarId
NumVarId = NumExpression
NumVarId = AlphaVarId
BoolVarId = BoolExpression
TypedResVarId = TypedVarId | TypedReservedWord | TypedPredefinedFunction | TypedUserFunction
RESVarId = PrototypeProgram (Parameter 1, ..., Parameter n) (with ADELIA (I/B) only.)
Description
Assignment of a value in a variable.
Situation 1: AlphaVarId = AlphaExpression
For situations where the AlphaExpression is a concatenation expression, see concatenation operators.
In other situations, refer to situation 2 or 6 as applicable.
Situation 2: AlphaVarId = NumVarId
This situation is the same as MOVE_ON_LEFT NumVarId AlphaVarId.
Situation 3: NumVarId = NumExpression
See arithmetic operators for more details.
Situation 4: NumVarId = AlphaVarId
This situation is the same as MOVE_ON_RIGHT AlphaVarId NumVarId
Situation 5: BoolVarId = BoolExpression
This situation does not apply to ADELIA programs.
The "BoolVarId" variable takes the value of the BoolExpression result.
See detailed expression syntax for more details.
Situation 6: TypedResVarId = TypedVarId | TypedReservedWord | TypedPredefinedFunction | TypedUserFunction
The element to the right of the assignment must be the same type as "TypedResVarId" but:
- for alpha type, it can be a different length, and
- numeric type is to be understood in the broad sense (accepts a different length and number of decimal places and a different numeric type (packed, extended, integer, binary, etc.).
If TypedResVarId is alphanumeric:
- For ADELIA programs generated in RPG:
- If assignment is not managed in EVAL mode, the resulting variable is not cleared before loading and the element to the right is transferred to TypedResVarId one character at a time starting on the left, stopping when the shorter length of the two elements is reached.
- For ADELIA programs generated in RPG:
- If assignment is managed in EVAL mode, whenever data is placed in a result field, it will replace any data already there.
See the 3GL Generation tab in the environment attributes.
- If assignment is managed in EVAL mode, whenever data is placed in a result field, it will replace any data already there.
- For ADELIA programs generated in C, as well as for VADELIA, WADELIA, EADELIA and SADELIA programs, the resulting variable is cleared.
- If the value of the element to the right is longer than TypedResVarId, TypedResVarId will contain the truncated value to the right.
If TypedResVarId is numeric (in the broad sense) see arithmetic operators.
For other types, the value of TypedResVarId is replaced by the value of the element to the right.
NB: when there is an assignment between two class instance variables, CAST (type forcing) can be used.
Situation 7: RESVarId = PrototypeProgram (Parameter 1, etc., Parameter n)
This situation only involves ADELIA programs generated in RPG.
"PrototypeProgram" is a program assigned to a "*SRVPGM AS/400" task, and a formal result parameter was defined for "PrototypeProgram".
ResVarId retrieves the result of the called PrototypeProgram.
Example
a) Alphanumeric to alphanumeric
(Let's assume that FIELD_A = 'ZZZZZZZZZZ' and FIELD_B = 'ABCDE')
FIELD_A = FIELD_B
FIELD_A will be equal to 'ABCDEZZZZ' |
in an ADELIA program generated in RPG that does not manage EVAL assignments. |
FIELD_A will be equal to 'ABCDE' |
in a VADELIA, WADELIA, SADELIA, EADELIA or ADELIA program using a C generator, or an ADELIA program using an RPG generator that manages EVAL assignments. |
b) Numeric to alphanumeric
(Let's assume that FIELD_A = 'ZZZZZZZZZZ' and NUM_B = 000100)
FIELD_A = NUM_B
FIELD_A will be equal to '000100ZZZZ' |
in an ADELIA program generated in RPG that does not manage EVAL assignments. |
FIELD_A will be equal to '000100' |
in a VADELIA, SADELIA, WADELIA, EADELIA or ADELIA program using a C generator, or an ADELIA program using an RPG generator that manages EVAL assignments. |
c) Numeric to numeric
(Let's assume that NUM_A = 999999999 and NUM_B = 000100)
NUM_A = NUM_B
NUM_A will be equal to 000000100 |
d) Alphanumeric to numeric
(Let's assume that NUM_A = 999999999 and FIELD_C = '012' (alpha 3 characters long))
NUM_A = FIELD_C
NUM_A will be equal to 999999012 |
in an ADELIA program. |
NUM_A will be equal to 000000012 |
in a VADELIA, SADELIA, WADELIA, EADELIA program. |
↑ Top of page Copyrights Ι ©Hardis Group 2025 - Any partial or total reproduction of the content, not expressly authorized by Hardis Group, is strictly prohibited.