Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bitwise function(s) Question -- Again!
Message
 
 
To
13/11/2002 15:26:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00722339
Message ID:
00722522
Views:
20
Gary,

I'll throw another way into the mix which I think is clearer and doesn't require conversion to bit numbers for the ClearBit()
? bitand( nFlags, bitnot( 8 ) )
The bitnot() inverts all of the bits, so it puts a 0 for each bit of what you are wanting to turn off and 1s everywhere else. When this is bitanded to the other value it changes them to 0.

This will also work if you are wanting to clear more than one bit at a time.

>
>nFlags = Bitor(8,2)
>
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform