help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'System' (#rtl)

hi

Return high byte/word of value.

Declaration

Source position: line 0

function hi(

  b: Byte

):Byte;

function hi(

  i: Integer

):Byte;

function hi(

  w: Word

):Byte;

function hi(

  l: LongInt

):Word;

function hi(

  l: DWord

):Word;

function hi(

  i: Int64

):DWord;

function hi(

  q: QWord

):DWord;

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 returned. Hi cannot be invoked on types of size 1, such as byte or char.

Errors

None

See also

Lo

  

Return low byte/word of value.

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.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505