Copies a subset block of bits from one unsigned integer to another.
Namespace:
RRAutoLib.Loconet
Assembly:
RRAutoLib (in RRAutoLib.dll) Version: 4.0.8678.28884
SyntaxParameters
- intSource
- Type: SystemUInt32
Bit source to copy from. - bytSrcLoc
- Type: SystemByte
Start location of the source bit block. Location is zero based where zero is the least significant bit and the location is the least significant bit of the block. - bytSrcLen
- Type: SystemByte
Number of bits in the block to copy from the source bytes. Bits are counted from right to left starting at bytSrcLoc. - intTarget
- Type: SystemUInt32
Bit target to copy over. Results are returned through this parameter as well as the function's return value. - bytTrgLoc
- Type: SystemByte
Start location of the target bit block. Location is zero based where zero is the least significant bit and the location is the least significant bit of the block.
Return Value
Type:
UInt32
Examples
Given a byte
S of [S7,
S6,
S5,
S4,S3,S2,S1,S0] and a byte
T of [T7,T6,T5,T4,T3,T2,T1,T0]
the following example will copy the bits in bold from
S overwritting the bits in
T resulting in [T7,T6,T5,T4,
S6,
S5,
S4,T0].
Original bits, other than the three overwritten, are left as they were.
See Also