RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.Hi Function

Returns the high-order byte of X as an unsigned value.

Pascal
function Hi(X): Byte;
C++
Byte Hi( X);

System

In Delphi code, use Hi to obtain the high-order byte of an expression of type Word or Integer.

Note: Hi treats Integer as a 16-bit value, even if it is 32-bit.
 

Delphi Examples: 

 

{
This example demonstrate use of the System Hi function to
store the high byte of a word or integer into a byte.
}
procedure TForm1.Button1Click(Sender: TObject);
var
  B : Byte;
begin
  B := Hi($1234);
  ShowMessage(Format('High byte of $1234 = $%x', [B]));
end;

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!