A little on the new bit shifting functions _SHR(shift right) and _SHL(shift left)
as functions _SHR(VALUE,AMOUNT ) [same applies to _SHL]
where VALUE is up to a INTEGER64 variable that you want shifted
and AMOUNT is the number of bits to move
null=_SHR(MyVariable,3) will shift the bits in MyVariable to the right by 3 and put the result in null
_SHL will have the effect of increasing the value, so in essence bit 0 is the right most bit. so a value of 1 would have bit 0 turned on( as _byte: 0000 0001) example
a~%%=1 'as bits (0000 0001)
b~%%
=_SHL(a~%%
, 1) 'shift it by 1 and it is now (0000 0010)
the output would be 2 (0000 0010)
_SHR will have the effect of decreasing the value, and bits are simply dropped off the end of the value.
taking b~%% from the above code
now c~%% will be 0 cause we moved the bit from (0000 0010) over 2 which made it drop off leaving (0000 0000)
Trying to shift a value of 0 will have no result because there are no 'set' bits too move. [(0000 0000) no '1's to move!]
it is possible to move the bits too far left and get the same result, going with (0000 0010) we
c~%%=_SHL(b~%%,7)
and wind up with 0 because we move the bit clear off the left side requiring at least an INTEGER to hold the new value.
Values up to INTEGER64, you can have signed or unsigned depending on what variable use use to hold the returned value a%%_SHL(1,7) will be -128 while a~%%=_SHL(1,7) will be 128