HBOUND Function

Purpose

Returns a fixed-point binary integer that is the upper bound of a specified dimension of an array.

Syntax

HBOUND(x[,n])

Parameters

x is an array variable and n is an integer constant indicating the nth dimension of x.

Description

The HBOUND function returns a fixed-point binary integer that is the upper bound of a specified dimension of an array x. This allows you to determine the upper bound of an array with * extents.

n is the specified dimension of the array. If n is not present, 1 is assumed. When present, n must be greater than zero and less than or equal to the number of dimensions declared.

The precision of the result is Fixed Binary(31).

Examples

DECLARE R FIXED BINARY; 
DECLARE A(3:5,2,-10:10,4:7);
   .
   .
   .
R = HBOUND(A,1);     /*R = 5*/
   .
   .
   .
R = HBOUND(A,2);     /*R = 2*/
   .
   .
   .

Restrictions

The HBOUND function is now supported with expression arguments.