CT_NUMHIGH

 NUMHIGH()
 Returns the higher value byte in a 16-bit number
------------------------------------------------------------------------------
 Syntax

     NUMHIGH(<nWORD|cHexWORD>) --> nByte

 Argument

     <nWORD|cHexWORD>  Designates either a decimal number or hexadecimal
     digit string.

 Returns

     The higher value byte of the <nWORD|cHexWORD> 16-bit number is returned.

 Description

     NUMHIGH() breaks down a 16-bit number into its two bytes and returns the
     higher byte as a result.  Use this for such functions as SCANKEY() or
     GETCURSOR(), because NUMHIGH() separates the two bytes of the keyboard
     scan code.

 Note

     .  An invalid parameter returns a value of -1.

 Example

     Break down the combined return value of GETCURSOR():

     ? "Starting line for the cursor is:", NUMHIGH(GETCURSOR())

See Also: NUMLOW()



Introduction Number and Bit Manipulation

Introduction CT Number and Bit Manipulation

This module discusses number and bit manipulation. Specifically, the numeric section deals with conversions between two different number systems, and the creation of random numbers.

The bit manipulation section covers such required binary operations as AND, OR, XOR, and NOT, and how to test, set and clear bits. The NUMLOW() and NUMHIGH() functions are important for CA-Clipper Tools functions that take two 8-bit values and return them as combined 16-bit numbers. An example is the GETCURSOR() function from the Extended Drivers module.

Many of the functions in this module have a <value> parameter type. In this case, a number can be in the range of 0 to 65535 (or 4 294 967 295) and/or a hexadecimal string in the range of “0000” to “FFFF” (or “FFFFFFFF”).

CT Number and Bit Manipulation Functions

 

Tools – Numbers/Bit Manipulation

Introduction
BITTOC()     Converts position-dependent bits into characters
CELSIUS()    Converts a Fahrenheit temperature value into Celsius
CLEARBIT()   Clears one or more bits within a number to zero
CTOBIT()     Converts a character string into a bit pattern
CTOF()       Converts a special 8-byte string into a floating point number
CTON()       Converts a numeric string into a different base
EXPONENT()   Determines the exponent of a floating point number (base 2)
FAHRENHEIT() Converts a temperature value from Celsius into Fahrenheit
FTOC()       Converts a floating point number into a special 8-byte string
INFINITY()   Creates the largest number possible (21023)
INTNEG()     Converts an unsigned integer into a signed integer
INTPOS()     Converts a signed integer into an unsigned integer
ISBIT()      Tests the bits in a number
LTON()       Converts a logical value into a numeric value
MANTISSA()   Determines the mantissa of a floating point number (base2)
NTOC()       Converts numbers in a digit string into a different number base
NUMAND()     Performs a 16-bit "AND" of a list of numbers
NUMCOUNT()   Uses the internal CA-Clipper Tools counter
NUMHIGH()    Returns the higher value byte in a 16-bit number
NUMLOW()     Returns the lower value byte in a 16-bit number
NUMMIRR()    Mirrors 8-bit or 16-bit values
NUMNOT()     Performs a 16-bit "NOT" of a number
NUMOR()      Performs a 16-bit "OR" of a list of numbers
NUMROL()     Performs a 16-bit left rotation of a number
NUMXOR()     Performs a 16-bit "XOR" of two numbers
RAND()       Generates random numbers
RANDOM()     Generates random numbers
SETBIT()     Sets one or more bits in a number