If NOT?
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <C3339561D7B7F246B51D79A63BA14BEC014F3B29@drsse603.eu.infineon.com> |
I am trying to do an if not against a string. I have never gotten this
to work correctly and have done cheap little work arounds but thought I
might see how to properly do this. Here is the scenario.
I have a string value: $NETCHECK = "NO"
Prior to performing a task I want to make sure this is NOT set to NO.
So I wrote a quickie test script like this:
$NETCHECK = "No"
If $NETCHECK NOT = "Yes" Then
MsgBox(0,"test","Yes")
Else
MsgBox(0,"test","No")
EndIf
It does not respond properly. I have tried the following variations:
If NOT $NETCHECK = "Yes" Then
If NOT $NETCHECK "Yes" Then
If $NETCHECK NOT "Yes" Then
None of these return properly. In the past I would have just done this
If $NETCHECK = "No" Then
Else
MsgBox(0,"test","No")
EndIf
I also considered doing this:
If NOT STRINGINSTR($NETCHECK,"no") Then
MsgBox(0,"test","No")
EndIf
I was just hoping for a cleaner/more efficient way of doing it.
Thanks in advance.
[Non-text portions of this message have been removed]