Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>isbit()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ISBIT()

Syntax:     ISBIT(<expH>[,<expN>])

Arguments:  <expH> is either a decimal number or a hexadecimal string
            of digits.
            <expN> denotes the bit that is required to be tested.

Returns:    A logical value.
            The function will return (.T.) when the indicated bit is set.

Usage:      With ISBIT() it is possible to test a particular bit in a bit
            field without having to first mask the field, then do a
            comparison.

Notes:      The range of values for <expN> lies between 1 and 16.  The
            value 1 will then represent the bit with the lowest
            significance; 16 will represent the bit with the highest.  If
            <expN> is omitted, then it takes the value 0, and the
            function will default to check the bit with the lowest
            significance.

Library:    CT1.LIB


--------------------------------- Example ------------------------------

Examples:   * Test the bit for BREAK (bit 5) in the line
            * status register of the serial interface COM1:.

            IF ISBIT(COM_LSR(1),5)

               ? "BREAK condition detected."

            ENDIF



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

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