![]() Arrays (Tables) |
![]() DEVELOPER |
![]() |
Arrays (Tables)
An array (or table) is a collection of elements that are associated with a single variable name. Only single-dimensional arrays with a limit of 999 elements are used in PROIV.
There are two ways to specify a PROIV array:
-
If the array is stored in a file record, it is defined at the File Definition screen by specifying an array size for a variable. The array is stored in each record of the file but may contain different values in each record.
-
If the array is needed in only one function, a scratch array is defined in Logic ID 000 through the use of the DEFINE statement. All values in the array must be set up in the function and are lost when the function is exited.
The format to use when referencing an array element is variable(index). When an array element is referenced in this form, it is called a subscripted variable. The index can be any valid numeric constant, variable, or expression resulting in a value from 1 to the maximum number of elements allowed for the entry. To ensure correct interpretation of an index expression, be sure to include spaces around any operators used, for example, #A(#B + 2). File array variables may be used anywhere other file variables are used, except as file keys.
Topic ID: 730124