Click to See Complete Forum and Search --> : How can Shift a Hex value in VB.
abkareem
August 2nd, 1999, 04:38 AM
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.
Lothar Haensler
August 2nd, 1999, 06:30 AM
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
Cimperiali
November 6th, 2001, 05:30 AM
;)
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
Iouri
November 6th, 2001, 07:14 AM
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
iouri@hotsheet.com
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.