BitMaskRead
Performs a bitwise mask read operation.
Method Signature
BitMaskRead(number=[integer], start=[integer], length=[integer])
Arguments
Argument
Type
Required
Description
Default
number
integer
true
32-bit signed integer from which to read the mask.
start
integer
true
Start bit for the read mask (Integer in the range 0-31, inclusive).
length
integer
true
Length of bits in the read mask (Integer in the range 0-31, inclusive).
Examples
Bitwise Mask Read
Uses the bitMaskRead function to read each of the corresponding bits specified in the mask
bitMaskRead( 3, 0, 1 );
Result: 1
Using non zero start parameter
Bit shift the mask 2 places
bitMaskRead( 10, 2, 1 );
Result: 0
Using non zero read mask start and length parameters
bitMaskRead( 10, 1, 3 );
Result: 5
Additional Examples
writeOutput( bitMaskRead( 255, 5, 5 ) );
writeOutput( "<br>" );
writeOutput( bitMaskRead( 255, 0, 4 ) );
Related
Last updated
Was this helpful?