Jump to content

Recommended Posts

Posted

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
endif

I lost 2 days of logs and it's my fault for not testing, but I ASSumed the above statement worked fine.

Thanks

Jon

Posted

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 *

Posted (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.

:lmao:

Edited by MHz

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...