VALUE |
Value is used to declare arguments of a sub-programme, specifying that they have been passed by value.
Value word_type list_var_dim
|
Element |
Description |
Restrictions |
|
word_type |
One of the key words used for
declarations: |
This must be an Adonix data type. |
|
list_var_dim |
List ofvar_dim separated by the character ','. |
None. |
|
var_dim |
Variable expressed in one of
the following forms: |
None. |
|
nom_var |
name_of_variable. |
None. |
|
list_sep |
List of ',' separations (the place normally taken by the dimensions expression stays empty, and only the number of dimensions is therefore declared). |
Not more than 3 separators, since the number of dimensions is limited to 4. |
# Declaration of Call arguments
Subprog SOUS_TRAIT(ARGUMENT1, ARGUMENT2, ARGUMENT3)
Value Integer
ARGUMENT1(,,) :# ARGUMENT1 is a 3-dimension table
Value Char
ARGUMENT2()(,) :# ARGUMENT2 is a 2-dimension table
Value Date
ARGUMENT3 :# ARGUMENT3 is a date
(without dimension)
Value is used to declare that arguments of a sub-programme are passed by value, that is copied to a local variable created at the time of the Call. Modifications made to this variable will therefore not be assigned to variables passed in the argument of the Call instruction.
A Value command is given automatically for arguments of a sub-programme not declared in this sub-programme, when these arguments are expressions (when they are variables, a Const command is given).
If expressions are to be passed as parametres, they must be declared as Value type (not not declared at all).
Passing parameters by value may take time and occupy memory for large tables, since they are recopied for a Value command.
|
Error |
Description |
|
ERMODE (10) |
Incompatibility of type between declaration of the argument and the parameter passed in the Call. |
|
ERDIM (55) |
The number of dimensions declared does not match the dimension of the variable passed in parameter. |
SHORTINT - DECIMAL - CHAR - DATE - INTEGER - LIBELLE - CONST - VARIABLE - CALL - SUBPROG
|
|