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>numand()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NUMAND()
 Performs a 16-bit "AND" of a list of numbers
------------------------------------------------------------------------------
 Syntax

     NUMAND(<nWORD1|cHexWORD1>,<nWORD2|cHexWORD2>,
        [...<nWORDn|<cHexWORDn>]) --> nWORD-AND

 Argument

     <nWORD1|cHexWORD1>, <nWORD2|cHexWORD2>, ...<nWORDn|cHexWORDn>
     Designates either decimal or hexadecimal number strings.

 Returns

     NUMAND() joins all designated parameters with the logical "AND" and
     returns the result.

 Description

     This function makes it simple to test several bits in a number
     simultaneously.  If bits are connected in an AND configuration, you can
     mask out specific bits and the unneeded bits are reset to 0.  All the
     numbers specified as parameters are then connected with AND.

 Note

     .  An invalid parameter returns a result of -1.

 Example

     Test an interface register:

     The register contains:         00011101
     The constant in binary:        00000111
                                    ________
     The result: (5)                00000101
     nStatus  := COM_MSR()
     IF NUMAND(nStatus, 7) = 5
        ? "Bit 1 and Bit 2 are set!"
     ENDIF


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

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