Node:High, Next:if, Previous:Halt, Up:Reference

### High

#### Synopsis

    function High (ordinal_type_or_variable): ordinal_type;

or

    function High (array_type_or_variable): array_index_type;

or

    function High (string_variable): Integer;

#### Description

For ordinal types or variables of that type, `High` returns the highest value a variable of that type can assume.

For array types or variables of that type, `High` returns the highest index a variable of that type can assume. Note: the result is of the same type as the array index is. If the array has more than one dimension, `High` returns the highest index in the first dimension.

If the argument is a string variable, `High` returns the discriminant of the string type (i.e. its capacity).

#### Conforming to

`High` is a Borland Pascal extension.

#### Example

    program HighDemo;
    type
      Colors = (Red, Green, Blue);
    var
      Col: array [Colors] of (Love, Hope, Faithfulness);
      Foo: Colors;
      Bar: Integer;
      Baz: String (123);
    begin
      Foo := High (Col);             { yields Blue }
      Bar := Ord (High (Col[Foo]));  { yields Ord (Faithfulness), i.e., 2 }
      Bar := High (Integer);         { returns highest possible ``Integer'' }
      Bar := High (Baz)              { returns 123 }
    end.

#### See also

Low