xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

NumHigh()

Retrieves the high byte of a 16-bit integer.

Syntax

NumHigh( <nInteger>|<cHex> ) --> nHighByte

Arguments

<nInteger>
A numeric 16-bit integer value can be specified as first parameter.
<cHex>
Alternatively, the integer can be passed as a hex-encoded character string (see NumToHex()).

Return

The function returns the high byte of a 16-bit integer as a numeric value.

Info

See also:NumLow()
Category: CT:NumBits , Numbers and Bits
Source:ct\numlohi.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays the high byte of a 16-bit integer.

   PROCEDURE Main
      LOCAL nValue := HexToNum( "ABCD" )
      LOCAL nByte

      ? nValue                      // result: 43981
      ? nByte := NumHigh( nValue )  // result: 171
      ? NumToHex( nByte )           // result: AB

      ? nByte := NumLow( nValue )
      ? NumToHex( nByte )
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe