[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 9.109 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

section 9.147 Low

This document was generated by Frank Heckenbach on May, 10 2002 using texi2html