%SUBARR built-in function returns a section of the specified Array starting at Start-index. The number of elements returned is specified by the optional Num-elements parameter, or, if not specified, the number of elements returned defaults to the remainder of the array.
%SUBARR (Array, Start-index {, Num-elements})
Required. This parameter must be an array. eg, a standalone field, data structure, or subfield defined as an array. This parameter must not be a table name or procedure call.
Required. This parameter must be a numeric value with zero decimal positions. Float numeric values are not allowed. The value must be greater than or equal to 1 and less than or equal to the number of elements of the array.
Optional. If specified, this parameter must be a numeric value with zero decimal positions. A float numeric value is not allowed. The value must be greater than or equal to 1 and less than or equal to the number of elements remaining in the array after applying the Start-index value. By default, the number of elements returned is the remaining of the Array.
Generally %SUBARR is valid in any expression where an unindexed array is allowed, However, %SUBARR cannot be used in the following places:
%SUBARR may be used in the following ways:
Note It is valid to use %SUBARR to assign part of an array to another part of the same array. However, if the source part of the array overlaps the target part of the array, unpredictable results can occur.
Built-in Function Overview
DCLARRAY
DCLDS
DCLDSFLD
EVAL
SORTARR
%LOOKUP