next up previous contents index
Next: Inc Up: Functions and Procedures Previous: Halt

Hi

   

Declaration:

Function Hi (X : Ordinal type) : Word or byte;

Description:

Hi returns the high byte or word from X, depending on the size of X. If the size of X is 4, then the high word is returned. If the size is 2 then the high byte is retuned. hi cannot be invoked on types of size 1, such as byte or char.

Errors:

None

See also:

Lo

Example
Program Example31;

{ Program to demonstrate the Hi function. }

var
  L : Longint;
  W : Word;
  
begin
  L:=1 Shl 16;     { = $10000 }
  W:=1 Shl 8;      { = $100 }
  Writeln (Hi(L)); { Prints 1 }
  Writeln (Hi(W)); { Prints 1 }
end.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998