Array.GetUpperBound

Syntax

GetUpperBound(Dimension: Integer): Integer;

Parameters

Dimension. Number of the dimension, the upper limit of which must be obtained. Dimensions numbering starts with one.

Description

The GetUpperBound method returns the upper limit of the dimension, the number of which is passed as the Dimension input parameter.

Example

Sub Main;

Var

Ar: Array[-5..10, 15];

Upper, i, j: Integer;

Begin

For i := -5 To 10 Do

For j := 0 To 14 Do

Ar[i, j] := i * j;

End For;

End For;

Upper := Ar.GetUpperBound(1);

End Sub Main;

After executing the example data is written to the Ar two-dimensional array, and the Upper variable will contain the upper limit of the first dimension, in this case, 10.

See also:

Array