Jump to content

If not command


Recommended Posts

Here it's the code. The only thing it does read the url hml and grab a stringbetween then use $feature[0], $feature[2], $feature[3], $feature[4], and $feature[5] and keep at it until all string been search if value not match else feature elseif not $feature[$a] == "value" then

MsgBox(0, "nada", "Nothing")

but is not working propertly

CODE
#include <IE.au3>

#include <String.au3>

#include <array.au3>

$number = "1"

For $i1 = 0 To 9999

$soIE1 = _IECreate("http://www.freewebs.com/lukejrs/testvar.html", 1, 1) ;OPEN BROWNSER URL

$sText1 = _IEDocReadHTML($soIE1) ;READ FROM HTML CODE ON WEBSITE

$feature = _StringBetween($sText1, 'teleFeature.code = "', '";') ; FEATURE

For $a = 0 To UBound($feature) - 1 ; maybe $i = 1 if you needn't the count.

if $feature[$a] == "68819" Then

MsgBox(0, "WE FOUND", "68819")

ExitLoop

ElseIf $feature[$a] == "73501" then

MsgBox(0, "WE FOUND", "73501")

ExitLoop

ElseIf $feature[$a] == "73417" And $feature[$a] == "72146" Then

MsgBox(0, "WE FOUND", "73417 and 72146")

ExitLoop

ElseIf Not $feature[$a] == "68819" or Not $feature[$a] == "73501" or Not $feature[$a] == "73417" or Not $feature[$a] == "72146" then

MsgBox(0, "nada", "Nothing")

ExitLoop

EndIf

Next

MsgBox(0, "Counting", $number)

$number += 1

Next

View source on url given take a look.

Link to comment
Share on other sites

ElseIf $feature[$a] == "73417" And $feature[$a] == "72146" Then

Not sure how do you expect one element of the array ($feature[$a]) to be equal 2 different things ("73417" and "72146") at the same time?

ElseIf Not $feature[$a] == "68819" or Not $feature[$a] == "73501" or Not $feature[$a] == "73417" or Not $feature[$a] == "72146" then

This is

1) pointless, because simple Else would do the same for what you indend it to do.

2) even then, it's still false logic, because "Not" operator has higher precedence than "==", which basically makes the above always false.

"be smart, drink your wine"

Link to comment
Share on other sites

Not is highest precedence of an operator.

So, If Not condition1 = condition2 is interpreted as Not condition1 first, then = condition2 second. You would be best to not use Not, but rather If condition1 <> condition2 to get the logic that you want.

:)

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...