Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Bitwise Functions. ---PLEASE HELP!
Message
From
12/10/2001 14:29:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
VFP Bitwise Functions. ---PLEASE HELP!
Miscellaneous
Thread ID:
00567866
Message ID:
00567866
Views:
102
I am trying to use VFP's native bitwise functions to recreate something that was written in another language, namely Visual Objects. The problem is that VFP's bitwise functions return different values than Visual objects. JFYI, the function is called CRCFill, which fills a table with values returned from using bitwise functions. The only thing that I can see that is different in VO's method right off the bat is that VO requires variable typing and all of the vars in this particular method are created as ShortINT

But let me explain what I mean about the differing values...I did the following in VFP6:

lcTest = 1
lcTest = bitlshift(lcTest,8) && lcTest now equals 256
lcTest = bitlshift(lcTest,1) && lcTest now equals 512
lcTest = bitlshift(lcTest,1) && lcTest now equals 1024
lcTest = bitlshift(lcTest,1) && lcTest now equals 2048
lcTest = bitlshift(lcTest,1) && lcTest now equals 4096
lcTest = bitlshift(lcTest,1) && lcTest now equals 8192
lcTest = bitlshift(lcTest,1) && lcTest now equals 16384
lcTest = bitlshift(lcTest,1) && lcTest now equals 32768

The above equivalant functions created in Visual Objects return the same values, UNTIL you get to the last one, which instead of returning 32768, it returns -32768....??

Any ideas why VFP's bitwise functions return different values, and how I can get them to return the same values as VO? Thanks. -Jeff
Next
Reply
Map
View

Click here to load this message in the networking platform