Quote:

Oh, how does one adequately check to see if a bit is toggled on in oredr to use simple math to turn a flag on or off? You use bitwise oparations. So why use bitwise operators just to then use addition and subtraction?




Errr yes If you read back you'll see that I don't at any point advocate using simple maths instead of bitwise operations, in fact I stress that it's a bad idea.

The simple maths examples are there to:
  1. To complete the story for those people who may not get complex bitwise operations but can readily understand bitwise AND and ORs as conditional tests.
  2. To give an alternative for anyone who is revision locked - bitwise NOT is only available with recent versions of KiXtart
  3. To demonstrate a KiXtart version of the technique of (re)setting bits which for some reason appears to be commonly used in VB scripts.