|
|
|||||||
To perform bitwise operation like | and & where one needs to turn off a bit we need a bitwise negation operator. Turn on bit: $x = $x | 64 Turn off bit: $x = $x & ~64 In this example "~" performs a bitwise negation so that performing a bitwise "and" of bits only turn off the bit representing 64. |
||||||||
|
|
|||||||
See my comments in the original thread re word size. While you are waiting, here is a UDF NOT function: Code: Function funNot($dValue,Optional $iWordSize) To use: Code: Turn off bit: $x = $x & funNot(64) If the size of the mask is important, supply the optional word size: Code: "The maximum value of an 8 bit word (byte) is: " funNot(0,8) I've left the default word size set as 16 bits. |