how can i convert these C line:
(py>>6)<<6)
to VB6?
Remove the trailing )
and it should work.
VB6 doesn't support <<. As best I can determine, the C code is shifting bits to the right, then back to the left, effectively clearing the lower 6 bits.
In VB6, you can do the same by:
Dim py As Long
Dim shiftedValue As Long
shiftedValue = py / (2 ^ 6) ' Shift right by 6 positions
shiftedValue = shiftedValue * (2 ^ 6) ' Shift left by 6 positions
Likely, someone could write more efficient code, but this seems to work.
Glad you were able to work it out. Why are you still using VB6?
I always recommend ditching VB6. It is super old technology. If you were using Python 2.x I would also advise moving to Python 3.x for the same reason. If you stick with the old you will be left behind. If I were a potential employer I would not hire anyone who only worked in old tech except for the very rare case when it is required to maintain legacy code like COBOL. It would not surprise me in the least if upcoming versions of Windows would not even run VB6 programs.
Reverend Jim: i installed the VS2010.. seems much more faster on my laptop ;)
This might work too:
shiftedValue = py And &HFC00&
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.