Dear all,
I have a Hex value. I want to shift the Hex value to left 4 position. How I can do it? .. Is any function avialable ?
Regards,
Kareem.
Printable View
Dear all,
I have a Hex value. I want to shift the Hex value to left 4 position. How I can do it? .. Is any function avialable ?
Regards,
Kareem.
try this (I got this from "Crazy D @ work"
private Function LShiftWord(byval w as Integer, byval c as Integer) as Integer
Dim dw as Long
dw = w * (2 ^ c)
If dw And &H8000& then
LShiftWord = CInt(dw And &H7FFF&) Or &H8000
else
LShiftWord = dw And &HFFFF&
End If
End Function
;)
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Shifting to the left acts as a multiplier and to the right divides.
If you myltiply by 16 you will shift 1 position. Multiply (or divide) as many times as possible). I think it should work
Iouri Boutchkine
[email protected]