Pass indeterminate arrays as parameters
- Last Updated: December 3, 2025
- 2 minute read
- OpenEdge
- Version 12.2
- 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 a fixed indeterminate
array to a routine whose corresponding parameter is a determinate
array defined as an
INPUT,INPUT-OUTPUT, orOUTPUTparameter with the same extent. - You can pass an unfixed indeterminate array to a routine whose corresponding
parameter is another unfixed indeterminate array defined as an
INPUT,INPUT-OUTPUT, orOUTPUTparameter. - You can pass a determinate array or an indeterminate array (fixed
or unfixed) to a routine whose corresponding parameter is an unfixed
indeterminate array. When passing a determinate or a fixed indeterminate array
to an unfixed indeterminate array defined as either an
INPUTorINPUT-OUTPUTparameter, the unfixed indeterminate array parameter inherits the fixed dimension from the calling routine (but its definition remains unfixed). When passing a fixed array to an unfixed indeterminate array defined as anOUTPUTparameter, the extents must match upon returning to the calling routine. In this case, the called routine must fix the extent by either applying theEXTENTstatement or inheriting the fixed dimension from another called routine. - You can pass an unfixed indeterminate array to a routine whose corresponding
parameter is a determinate array defined as an
OUTPUTorINPUT-OUTPUTparameter. In this case, the unfixed indeterminate array inherits the fixed dimension from the called routine. Likewise, an unfixed indeterminate array inherits the dimension of an indeterminate array parameter fixed using theEXTENTstatement in the called routine. You cannot pass an unfixed indeterminate array to a routine whose corresponding parameter is a determinate array defined as anINPUTparameter. - You cannot pass an unfixed indeterminate array 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 unfixed indeterminate array:
|
In this case, the unfixed indeterminate array parameter inherits the fixed dimension from the calling routine (but its definition remains unfixed).
The following example passes an unfixed indeterminate array as an output parameter to a routine that defines the parameter as a determinate array:
|
In this case, the unfixed indeterminate array parameter inherits a fixed dimension from the called routine.
The following example passes an unfixed indeterminate array as
an output parameter to a routine that also defines the parameter
as an unfixed indeterminate array, but fixes the dimension of the
array using the EXTENT statement:
|
In this case, the unfixed indeterminate array parameter also inherits a fixed dimension from the called routine.