High

From SCAR Divi Manual
Jump to: navigation, search

Definition

function High(x): Int64;

Availability

SCAR Divi 3.00 > Current

Description

Returns the upper bound of an array or data type specified in x. The function only works with arrays and Category:Basic Types, the entry format is fairly trivial, it can be a value, constant or variable.

Example

var
  a: array[1..5] of string;
  b: TStringArray;
  c: Integer;
  d: Byte;
begin
  SetLength(b, 5);
  WriteLn('The upper-bound of static array with range 1..5 is ' + IntToStr(High(a)));
  WriteLn('The upper-bound of a dynamic array with length 5 is ' + IntToStr(High(b)));
  WriteLn('The upper-bound of an integer is ' + IntToStr(High(c)));
  WriteLn('The upper-bound of a byte is ' + IntToStr(High(d)));
end.

Output:

The upper-bound of static array with range 1..5 is 5
The upper-bound of a dynamic array with length 5 is 4
The upper-bound of an integer is 2147483647
The upper-bound of a byte is 255

See Also