Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BITLSHIFT
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00293960
Message ID:
00294448
Views:
23
>Now it makes sense. Thank you very much.

David,

What's happening here is that VFP is assuming that the integer is signed, rather than unsigned. Here's another way around the problem:
lnresult = BITLSHIFT(lnsomevalue, 4)
IF BITTEST(lnresult, 31)
  lnresult = lnresult + (2 ^ 32)
ENDIF
? TRANSFORM(lnresult, "@0")
Should get you what you want.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform