Boolean Not operator in VBScript
- by Lumi
Consider the following two conditionals (involving bitwise comparisons) in VBScript:
If 1 And 3 Then WScript.Echo "yes" Else WScript.Echo "no"
If Not(1 And 3) Then WScript.Echo "yes" Else WScript.Echo "no"
Prints first yes, then no, right?
cscript not.vbs
Wrong! It prints yes twice!
Wait a second, the Not operator is supposed to perform logical negation on an expression. The logical negation of true is false, as far as I know. Must I conclude that it doesn't live up to that promise? How and why and what is going on here? What is the rationale, if any?