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?

So to simplify:

Code:
; To check a flag a flag:
If $objUserFlags & $ADS_UF_DONT_EXPIRE_PASSWD
"Flag is turned ON" ?
Else
"Flag is turned OFF" ?
EndIf



When using bitwise operations it really is necessary to check if a bit is toggled or not. You can just set it or turn it off without regard for its previous state unless your program flow is dependent on the bit value.


Code:
;To clear a flag
$objUserFlags=$objUserFlags & ~$ADS_UF_DONT_EXPIRE_PASSWD



Code:
;to set a flag
$objUserFlags=$objUserFlags | $ADS_UF_DONT_EXPIRE_PASSWD

_________________________
Home page: http://www.kixhelp.com/hb/