Products Downloads


French version


 

When using an array, remember to include it in the data environment of the program.

 

One-dimensional arrays: indicate the number of elements in the "Dimension array 1" field.

Two-dimensional arrays (matrix): indicate the number of lines in the "Dimension array 1" field, and the number of columns in the "Dimension array 2" field.

Use: in addition to the instructions indicated above, a table element is used in the same way as a working variable.

 

Use of an array element: T(index number) for a one-dimensional array: "index number" contains the number of the element to process. T (index number 1, index number 2) for a two-dimensional array: "index number 1" contains the line number of the element to process, and "index number 2" the column number.

 

Note: The index number must be either a numeric variable or a numeric constant without decimals. Its value, when used in an array, must be greater than zero and less than or equal to the maximum number of elements in the array. For a matrix, the index numbers cannot be greater than the "line" and "column" dimensions of the matrix, and must be greater than zero.

 

Example:

MONTH_DESC(12) = 'December'

T(10) = T(I) + T2(12,J)

IF T2(1,5) = 0 AND T(I) <> T(J)

 

Overall use of the table: it is sufficient to indicate the name of the array.

 

Example:

T = *BLANK (every array element is reset to blank)

TN = 1 (1 is assigned to each element of the array)

T1 = T1 * 2 (each array element value is multiplied by 2)

 

Warning: Before Adelia version 5, arrays were not declared in the same manner.

Only one-dimensional arrays were authorized, and they had to be declared several times if the associated index numbers were different. The number of elements in these arrays are indicated in the field "Array (Version 4)". It is advisable not to declare tables in this way anymore. Do not use these "Version 4" arrays with the C generator.

 

Example:

Variable

Guide word

Length

Array (Version 4)

ARR,I 

ARR_I 

6.0

20 (occurrences) 

ARR,J 

ARR_J

6.0 

20 

2.0 

 

2.0 

 

 

↑ Top of page

  • Aucune étiquette