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>setbit()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SETBIT()

Syntax:     SETBIT(<expH>,<expN1>[,...<expN16>])

Arguments:  <expH> is either a decimal numbers or hexadecimal string
            of digits.
            <expN1> to <expN16> are the number of bits required
            to be set.

Returns:    A numeric value.
            The bits denoted will be set and the result returned.

Usage:      With SETBIT() it is possible to set one bit, or several bits in
            a bit field in a targeted manner.  This might be used, foe
            example, in order to change a register to a serial interface.
            As distinct from NUMOR(), it is possible to indicate the
            number of bits, and it is not necessary for them to be
            converted beforehand.

Notes:      The range of values for <expN1> to <expN16> lies between
            1 and 16.  The value 1 will then represent the bit with the
            lowest significance, and 16 the highest.  An invalid argument
            will lead to the result -1.

Library:    CT1.LIB


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

Examples:   * Set the bits 1, 2 and 5 in the bit field

            bitfield = 0
            bitfield = SETBIT(bitfield,1,2,5)   && Result 19



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

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