Jump to content

Multi OR


Recommended Posts

Checkout this why "OR" not works thats my code

Global $color[2] = [0xE74747,0xE94747]


Func Refresh()
    $StartConst[0] = $Start[0] ; reset value
    While $StartConst[0] <> $End[0]
        Local $i
        $i += 10
        $StartConst[0] += 17
        $col = PixelGetColor($StartConst[0], $StartConst[1], $Title)

         ; get color 
        ;For $t = 0 to 2 ; <- i know it could be done in for loop but it not works in my program
            If $col <> $color[0] Then ; <- why this not works
                Global $NowVal = $i  ;
                GUICtrlSetData($m_actual, $NowVal) ; 
                ExitLoop
            EndIf
        ;Next
    WEnd
 
EndFunc

I want to check 2 colors without for loop but this below not works . it checks only first value why?

If $col <> $color[0] Or $col <> $color[1] Then ; <- why this not works

 

Link to comment
Share on other sites

  • Developers

What do you expect from that If other that it is always true? ;)

Do you want to test whether the $col is not equal to either color  and want an AND condition?

Jos

 

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

×
×
  • Create New...