VADELIA |
SADELIA |
WADELIA |
MADELIA |
|
(I/B) (C/S) |
(B) (S) |
(I/B) (C/S) |
(I) (C/S) |
Section for use
All
Syntax
Result = &ARRAY_DIM(ArrayName; Dimension)
Description
Used to return the size of an Adelia array declared statically of size 1 or 2.
Also gives the size of an array type class attribute with a dynamically or statically defined size.
Parameters
Definition |
Content |
Controls |
|
Result |
Variable of NUM_E or NUM_P type, length <= 9 with 0 decimal. |
Size of the array whose name has become a parameter. |
|
Array name |
Accessor of an array type attribute of a class. |
Name of the array for which the number of elements is calculated. |
Mandatory parameter. |
Dimension |
Numeric constant |
Value "1" or "2" to specify whether dimension 1 or 2 of the array is required. |
Optional parameter. |
Note:
Until an insertion has been made at the end - prompting a reallocation due to a capacity being exceeded - &ARRAY_DIM and &NBR_ELT return an identical value, which is the initial size of the array allocated by the NEW instruction.
After reallocation, &ARRAY_DIM returns the internal size allocated to the array (additional allocation in increments of 10 elements) while &NBR_ELT returns the effective number of elements contained in the array.
Parameters
ALPHA(10) MyArray1D(11)
ALPHA(10) MyArray2D(22.33)
REF_CLASS(MYCLASS) iClass
NbrElement = &ARRAY_DIM(MyArray1D)
NbrElement = &ARRAY_DIM(MyArray2D;1)
NbrElement = &ARRAY_DIM(MyArray2D;2)
NbrElement = &ARRAY_DIM(iClass.getAttributeMyArray1D())
NbrElement = &ARRAY_DIM(iClass.getAttributeMyArray2D();1)
NbrElement = &ARRAY_DIM(iClass.getAttributMyArray2D();2)
List of predefined functions by topic