Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bitwise function(s) Question -- Again!
Message
 
 
À
13/11/2002 15:26:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00722339
Message ID:
00722522
Vues:
21
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform