Progress
Language Reference


EXTENT Function

Interfaces
OS
SpeedScript
All
All
Yes

Returns the size of a named array field or variable. The function returns 0 if the field is not an array field. This is a pseudo-function; it compiles to a constant.

SYNTAX

EXTENT ( array ) 

array

Any array field or variable.

EXAMPLE

In the following example, the EXTENT function is used to set the limit of a DO loop that cycles through all elements of an array.

r-arrext.p
DEFINE VARIABLE int_value AS INTEGER EXTENT 3 INITIAL [1, 2, 3].

DEFINE VARIABLE i     AS INTEGER.
DEFINE VARIABLE tot   AS INTEGER LABEL "The total is".

DO i = 1 TO EXTENT(int_value):
   tot = tot + int_value[i].
END.

DISPLAY tot. 

SEE ALSO

DEFINE VARIABLE Statement, ENTRY Function


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095