As a start, here's the best I could do:
Code:
Function udfSwitchOffBits($iValue,$iOffBits)
$udfSwitchOffBits=$iValue ^ ($iValue & $iOffBits)
EndFunction



Which isn't as bad as I thought it'd be.