Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - resetbit() clear selected bit http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 resetbit()          Clear selected bit
------------------------------------------------------------------------------
 Declaration
   bit.hdr

 Syntax
   proc resetbit extern
   param       untyped xNumber, ;
         value uint    uBit

 Arguments
   xNumber is the value to operate on.
   uBit specifies the bit to clear.

 Return
   None.

 Description
   resetbit() clears a bit in the specified value xNumber. The lowest bit is
   addressed with uBit set to 0. The highest bit address depends on the
   type of xNumber.

 Example
   #define EXAMPLE_MATH
   #include example.hdr

   proc Test_resetbit
   vardef
      uint uValue
   enddef
   // reset the blink bit in an attribute value
   __syscolor[ CLR_STD ] := 0xff
   ? __syscolor[ CLR_STD ]
   resetbit( __syscolor[ CLR_STD ], 7 )
   ? __syscolor[ CLR_STD ]
   
   // make a number even
   uValue := 7
   ? uValue
   resetbit( uValue, 0 )
   ? uValue
   endproc

   proc main
   Test_resetbit()
   endproc

See Also: setbit()

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