CT_NUMMIRR

 NUMMIRR()
 Mirrors 8-bit or 16-bit values
------------------------------------------------------------------------------
 Syntax

     NUMMIRR(<nNumber|cNumber>,[<l8/16bit>])
         --> nResult

 Arguments

     < nNumber/cNumber>  Designates a numeric value in the range of 0 to
     65535, or a hexadecimal string within which 8 or 16 bits are mirrored.

     <l8/16bit>  Designates whether 16 bits (.F.) or 8 bits (.T.) are
     mirrored.  The default value is .F..

 Returns

     NUMMIRR() returns a value by which the bit opposite the first parameter
     is mirrored.  If there is an invalid parameter, a value of -1 is
     returned.

 Description

     Use this function in the accompanying font editor to mirror characters
     with bit patterns.  Bits with values in 0 to 65535 range are mirrored.
     When you mirror bit 16, bit 1 interchanges with bit 16, bit 2 with bit
     15, etc..  You can also designate the first parameter as a hexadecimal
     string in "0ABE" form and the result is always numeric.

 Examples

     .  Initialize the number to mirror:

        nVar  :=  128 + 64 + 8 + 2                // 00000000 11001010

     .  Mirror bit 16:

        ? NTOC(NUMMIRR(nVar), 2, 16, "0")         // 01010011 00000000

     .  Only mirror bit 8:

        ? NTOC(NUMMIRR(nVar, .T.), 2, 16, "0")    // 00000000 01010011

See Also: NUMAND() NUMHIGH() NUMLOW() NUMNOT() NUMOR()

 

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