Pass indeterminate arrays as parameters
- Last Updated: December 3, 2025
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
An indeterminate array is useful in a reusable routine that can handle any size array.
Consider the following when passing indeterminate array parameters:
- You can pass a determinate array or an indeterminate array with a size to a
routine whose corresponding parameter is a determinate array defined as an
INPUT,INPUT-OUTPUT, orOUTPUTparameter with the same size (extent). - You can pass an indeterminate array without a size to a routine whose
corresponding parameter is another indeterminate array without a size defined as an
INPUT,INPUT-OUTPUT, orOUTPUTparameter. - You can pass a determinate array or an indeterminate array (with or
without a size) to a routine whose corresponding parameter is an indeterminate array without
a size. When passing a determinate or a indeterminate array with a size to an indeterminate
array without a size, defined as either an
INPUTorINPUT-OUTPUTparameter, the indeterminate array parameter inherits the size from the calling routine (but its definition remains unchanged). When passing an array with a size to an indeterminate array without a size, defined as anOUTPUTparameter, the sizes must match upon returning to the calling routine. In this case, the called routine must set the size by either applying theEXTENTstatement or inheriting the size from another called routine. - You can pass an indeterminate array without a size to a routine whose
corresponding parameter is a determinate array defined as an
OUTPUTorINPUT-OUTPUTparameter. In this case, the indeterminate array inherits the size from the called routine. Likewise, an indeterminate array without a size inherits the size of an indeterminate array parameter with a size using theEXTENTstatement in the called routine. You cannot pass an indeterminate array without a size to a routine whose corresponding parameter is a determinate array defined as anINPUTparameter. - You cannot pass an indeterminate array without a size to a
COMobject, DLL routine, or UNIX shared library routine.
The following example passes a determinate array as an input parameter to a routine that defines the parameter as an indeterminate array without a size:
|
In this case, the indeterminate array parameter inherits the size from the calling routine (but its definition remains unchanged).
The following example passes an indeterminate array without a size as an output parameter to a routine that defines the parameter as a determinate array:
|
In this case, the indeterminate array parameter inherits the size from the called routine.
The following example passes an indeterminate array without a size as an
output parameter to a routine that also defines the parameter as an indeterminate array with
no size, but sets the size of the array using the EXTENT
statement:
|
In this case, the indeterminate array parameter also inherits a size from the called routine.