result = Rol(a, x[, length])
a
to the left by x
bits.
Bit rotation means that the bits just circle inside a
, i.e. bits moved
out of the left side are appended to the right side.
The optional argument length
allows you to specify the length of the rotate
operation. By default, this is #INTEGER
which means that a
will be
regarded as a 32-bit integer value. If you want to do a 16-bit or an
8-bit rotation, you need to use #SHORT
and #BYTE
, respectively.
#INTEGER
which means 32-bit rotation); use #SHORT
for 16-bit rotation
and #BYTE
for 8-bit rotationr = Rol(Val("%10011110"), 4, #BYTE) Print(BinStr(r, #BYTE))The code above rotates the binary number %10011110 4 bits to the left and prints the result which is %11101001.