masonje Posted October 16, 2006 Share Posted October 16, 2006 I have seen both of these used but using "Not" just bit me in the butt. Why did:if $clientCurUsr <> "nolog" Then ;....log endif ;....worked... ;...and "Not" didn't.... if not $clientCurUsr = "nolog" Then ;....log endifI lost 2 days of logs and it's my fault for not testing, but I ASSumed the above statement worked fine.ThanksJon Link to comment Share on other sites More sharing options...
GaryFrost Posted October 16, 2006 Share Posted October 16, 2006 Logical NOT operation. e.g. NOT 1 (equals 0)Test if two values are not equal. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
masonje Posted October 16, 2006 Author Share Posted October 16, 2006 But both should have ended up with the same outcome right? Why are the two statements not the same? Link to comment Share on other sites More sharing options...
GaryFrost Posted October 16, 2006 Share Posted October 16, 2006 But both should have ended up with the same outcome right? Why are the two statements not the same? nope for example: $Toggle = False $Toggle = Not Toggle MsgBox(0,"toggle", $Toggle) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
/dev/null Posted October 16, 2006 Share Posted October 16, 2006 I lost 2 days of logs and it's my fault for not testing, but I ASSumed the above statement worked fine. if not ($clientCurUsr = "nolog") Then endif Cheers Kurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
GaryFrost Posted October 16, 2006 Share Posted October 16, 2006 if not ($clientCurUsr = "nolog") Then endif Cheers Kurt forgot about using it that way, I try to stay away from negative evaluations tho. Sometimes have to. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
MHz Posted October 16, 2006 Share Posted October 16, 2006 (edited) @gafrost If you refer to negative evalutions as to being poor syntax, I totally agree. ; Good syntax (checking not condition) If Not $condition Then ; Poor syntax (checking equal condition and then not condition) If Not ($condition = $condition) Then ; Good syntax (checking not equal condition) If $condition <> $condition Then The last checks for unequal condition. The 2nd does a long way of doing the same. Checking if equal and then not in the same line is poor syntax. Edited October 16, 2006 by MHz Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now