EXTENT statement

Fixes the extent (number of elements) for an unfixed indeterminate array variable or parameter, or resizes a fixed indeterminate array variable or parameter. Once the extent is fixed, you can use the indeterminate array as you would any determinate array.

Syntax

EXTENT ( array ) = expression [ NO-ERROR ]
array
An expression that results in an ABL array.
expression
An INTEGER expression that evaluates to the extent value assigned to the array variable or parameter. The extent value can be any number between 1 and 28000, inclusive.
NO-ERROR
The NO-ERROR option is used to prevent the statement from raising ERROR and displaying error messages.

Example

The following example defines an unfixed indeterminate array variable and fixes its dimension using the EXTENT statement:

DEFINE VARIABLE x AS INTEGER NO-UNDO EXTENT.

MESSAGE EXTENT(x). /* Function returns ? */ 
EXTENT(x) = 4.     /* Statement fixes the extent to 4 */ 
MESSAGE EXTENT(x). /* Function returns 4 */ 

Notes

See also

DEFINE PARAMETER statement, DEFINE VARIABLE statement, EXTENT attribute, EXTENT function, NO-ERROR option, Parameter definition syntax