BitMaskRead |
Description
Performs a bitwise mask read operation.
Returns
An integer, created from length bits of number, beginning at start.
Category
Mathematical functions
Function syntax

    BitMaskRead(number, start, length)

See also
BitMaskClear, BitMaskSet
Parameters

Parameter | Description
number | 32-bit signed integer to mask
start | Integer, in the range 0-31, inclusive; start bit for read
length | Integer, in the range 0-31, inclusive; length of mask

Usage
Bit functions operate on 32-bit signed integers, in the range -2147483648 - 2147483647.

Example

    <h3>BitMaskRead Example</h3>
    <p>Returns integer created from <em>length</em> bits of <em>number</em>,
    beginning
    with <em>start</em>.

    <p>BitMaskRead(255, 4, 4): <cfoutput>#BitMaskRead(255, 4, 4)#
    </cfoutput>
    <p>BitMaskRead(255, 0, 4): <cfoutput>#BitMaskRead(255, 0, 4)#
    </cfoutput>
    <p>BitMaskRead(128, 0, 7): <cfoutput>#BitMaskRead(128, 0, 7)#
    </cfoutput>

number |
32-bit signed integer to mask

start |
Integer, in the range 0-31, inclusive; start bit for read

length |
Integer, in the range 0-31, inclusive; length of mask