bitMaskSet

Performs a bitwise mask set operation.

bitMaskSet(number, mask, start, length) → returns numeric

Argument Reference

number numeric
Required

Integer

mask numeric
Required

Integer mask

start numeric
Required

Start bit for the set mask (Integer in the range 0-31, inclusive)

length numeric
Required

Length of bits in the set mask (Integer in the range 0-31, inclusive)

Examples
Sample code invoking the bitMaskSet function

Performs masking operation on each of the corresponding bits

bitMaskSet(6, 1, 0, 1)

Expected Result: 7

Bit shift the mask 2 places

bitMaskSet(10, 1, 2, 1)

Expected Result: 14

bitMaskSet(10, 2, 1, 2)

Expected Result: 12

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub