Products Downloads


French version


 

Arrays have to be declared, before you are able to use them.

  • Declaring a one-dimensional array:
    AdeliaType ArrayId(NbElements)

For example:

ALPHA(15) A_MONTHS(12)

DATE A_DATE(5)

  • Declaring a two-dimensional array:
    AdeliaType ArrayId(NbLines,NbColumns)

For example:

ALPHA(10) ARRAY1(8,2)

 

Use: apart from the instructions described above, array elements are used in the same way as work variables.

 

  • Using an element in a one-dimensional array:

T(Index)

Index contains the element number to be processed.

  • Using an element in a two-dimensional array:

T(Index1,Index2)

Index1 contains the line number of the element to be processed.
Index2
contains the column number of the element to be processed.

 

Note: The index must be a numeric variable or a whole numeric constant. When the array is used, this index must have a value greater than zero and less than or equal to the maximum number of elements in the array. In matrices, the values of the index numbers must not exceed the "line" and "column" dimensions in the matrix, and must be greater than zero.

 

For example:

A_MONTHS(12) = 'December'

ARRAY1(10) = ARRAY2(I) + ARRAY3(12,J)

IF ARRAY3(1,5) = 0 AND A(I) <> A(J)

  • For a global use of the array, only indicate the name of the array.

For example:

T = *BLANK (all the elements in the array will be reset to blank)

TN = 1 (each element in the array will be set to 1)

T1 = T1 * 2 (the value of each element in the array will be doubled)

 

↑ Top of page


  • Aucune étiquette