| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
function High (ordinal type or variable): ordinal type; |
function High (array type or variable): array index type; |
function High (string variable): Integer; |
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).
`High' is a Borland Pascal extension.
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.
|
section 9.147 Low