setqbitfield
setqbitfield(s_varx_valx_msbx_lsb) =>x_result
Description
Sets a value into a set of bits in the bit field specified by the variable s_var, stores the new value back into the variable, and then returns the new value. Prefix form of the <:>= operator.
Arguments
|
Variable representing the bit field whose value is to be changed. |
|
|
Leftmost bit of the set of bits whose value is to be changed. |
|
|
Rightmost bit of the set of bits whose value is to be changed. |
Value Returned
Examples
x = 0
setqbitfield(x 0b1001 3 0)
=> 9
x => 9
setqbitfield(x 1 2 1)
=> 11
x => 11
setqbitfield(x 0 3 2)
=> 3
x => 3
Related Topics
Return to top