CT_CLEARBIT

 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()

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.