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 - maskbit() logical bitwise comparison http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 maskbit()           Logical bitwise comparison
------------------------------------------------------------------------------
 Declaration
   bit.hdr

 Syntax
   func logical maskbit extern
   param value uint uNumber, ;
         value uint uBitMask

 Arguments
   uNumber is a numeric expression.
   uBitMask is a numeric whose bits are used in testing.

 Return
   A logical indicating if the operation resulted in a number different
   from zero.

 Description
   This function tests each single bit in uNumber against uBitMask. The
   effect of the function is equivalent to encoding

   and( uNumber, uBitMask ) == uBitMask

 Example
   #define EXAMPLE_MATH
   #include example.hdr

   proc Test_maskbit
   ? maskbit( 7,  5 )         // prints .t.
   ? and(     7,  5 ) ==  5   // prints .t.
   ? maskbit( 7, 16 )         // prints .f.
   ? and(     7, 16 ) == 16   // prints .f.
   endproc

   proc main
   Test_maskbit()
   endproc

See Also: and()

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