Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>setbit()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SETBIT()
 Sets one or more bits in a number
------------------------------------------------------------------------------
 Syntax

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

 Arguments

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

     <nBitPos1> ...  <nBitPos32>  Designates which bit numbers to
     set.

 Returns

     SETBIT() sets the designated bits and returns the result.

 Description

     For example, SETBIT() allows you to set one or more bits to change a
     serial interface register.  This is in contrast to NUMOR(), where the
     bit numbers can be set and do not need to be previously converted.  The
     value 1 represents the bit with the lowest value; 32 is the bit with the
     highest value.

 Note

     .  An invalid parameter returns a result of -1.

 Example

     Set bits 1, 2, and 5 in a numeric field:

     nBitfield  :=  0
     nBitfield  :=  SETBIT(nBitfield, 1, 2, 5)   // Result:  19


See Also: NUMAND() NUMNOT() NUMOR() NUMXOR() ISBIT()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson