RE: If NOT? - What an idiot
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <C3339561D7B7F246B51D79A63BA14BEC014F3B40@drsse603.eu.infineon.com> |
It just dawned on me to use <>. I cannot believe that in the 7 or 8 years I have been using AutoIT I never thought to use <> in that scenario. Sorry for wasting everyone's time. Did I mention I am an idiot? Thanks ________________________________ From: Marx Keath (QNA IT GS ISA External) Sent: Thursday, January 04, 2007 10:45 AM To: '[email protected]' Subject: If NOT? 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]