Whatever message this page gives is out now! Go check it out!

BitMaskRead

Last update:
May 18, 2026

Description

Performs a bitwise mask read operation.

Returns

An integer, created from length bits of_ number,_ beginning at start.

Category

Function syntax

BitMaskRead(number, start, length)

See also

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> 
 
 <p>BitMaskRead(255, 4, 4): <cfoutput>#BitMaskRead(255, 4, 4)#</cfoutput></p> 
 <p>BitMaskRead(255, 0, 4): <cfoutput>#BitMaskRead(255, 0, 4)#</cfoutput></p> 
 <p>BitMaskRead(128, 0, 7): <cfoutput>#BitMaskRead(128, 0, 7)#</cfoutput></p>

Example

<cfscript>
  number = 255 ;
  start = 0 ;
  length = 4; 
  writeOutput(bitmaskread(number, start, length)) ;
</cfscript>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page