Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BitAnd() limitation?
Message
From
06/08/2004 17:28:17
 
 
To
06/08/2004 16:36:07
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00931430
Message ID:
00931454
Views:
26
>hello everybody.
>
>it seems, in Vfp6 Sp5, that the following works:
>
>?bitand(2^30, 2^30) = 2^30 && shows .t.
>but the next one does not
>?bitand(2^31, 2^31) = 2^31 && shows .f.
>
>is this the limitation of BitAnd()?
>
>if so, is there a workaround? currently i need to be able to check for values up to 2^33
>
>thanks for all your help in advance!

Definitely a limitation on BITAND and the other bit functions. They can only work on 32 bit numbers, but it seems it won't work on the 32nd bit as that's the sign bit. The help doesn't even mention 32 bits, but I think that's the case.

Some of the bit commands mention bits 0-31 and some don't. Also, I don't think you're using BITAND correctly, it returns the bits that are common to the parameters you pass, not a .T./.F. return value.

?TRANSFORM(BITAND(2^31,2^31),"@0x")

prints a value of 0x80000000, which is correct.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform