Description |
The GetUpperBound method returns the ending index for the specified array Dimension.
This is 1 less than the size of this dimension since arrays are 0 based.
|
|
Microsoft MSDN Links |
System
System.Array
|
|
|
A simple example |
program Project1;
{$APPTYPE CONSOLE}
var
myArray : System.Array;
upper : Integer;
begin
// Create a 10 element single dimension array of Integers
myArray := System.Array.CreateInstance(TypeOf(Integer), 10);
// Get the upper bound of the first and only (0) dimension
upper := myArray.GetUpperBound(0);
Console.WriteLine('UpperBound = {0}', upper.ToString);
Console.ReadLine;
end.
| Show full unit code | UpperBound = 9
|
|
|
|