[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 CLEARBIT()
 Clears one or more bits within a number to zero
------------------------------------------------------------------------------
 Syntax

     CLEARBIT(<nLONG|cHexLONG>,<nBitPos1>,
        [...<nBitPos32>]) -->  nNewValue

 Arguments

     <nLONG|cHexLONG>  Designates either a decimal number or hexadecimal
     character string.

     <nBitPos32>  Designates the bit numbers to delete.

 Returns

     CLEARBIT() returns a value in which the designated bits are cleared.

 Description

     CLEARBIT() resets particular bits within a field to change something
     like a serial port register.  In contrast to NUMAND(), the bit numbers
     are given and do not need to be converted beforehand.  The value 1
     represents the bit with the lowest value, and the value 32, the bit with
     the highest value.

 Note

     .  An invalid parameter returns a result of -1.

 Example

     Bits 3, 4, and 6 are cleared in a bit pattern:

     nBitPattern  := 255
     nBitPattern  := CLEARBIT(nBitPattern, 3, 4, 6)   // Result:  211


See Also: ISBIT() SETBIT() NUMAND() NUMNOT() NUMOR() NUMXOR()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson