Jump to content
Miliardsto

Multi OR

Recommended Posts

Miliardsto

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

 

Share this post


Link to post
Share on other sites
Jos

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

 

 


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Bilgus

that should be an AND if you want OR it needs to be

;And
if $col <> $Color[0] AND $col <> $Color[1] Then
;Or
if Not ($col = $Color[0] OR $col = $Color[1]) Then

 

Edited by Bilgus
  • Like 1

Share this post


Link to post
Share on other sites
Miliardsto

oshiet thanks xd

Share this post


Link to post
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

  • Similar Content

    • chacoya121
      By chacoya121
      plz help how to organize information from notepad or INIfile
      Example:
      0=000308 1=000308 2=000308 3=000308 4=000408 5=000408 6=000408 7=000408 8=000408 9=000408 10=000308 11=000308 12=000308 13=000408 14=000408 15=000408 16=000408 17=000408 18=000408 19=000408 20=000308 21=000308 22=000308 23=000408 24=000408 25=000408 26=000408 27=000408 28=000408 29=000408 30=000308  0=000308 x 11 total
       1=000408 x 20 total
      2 lines summary all
       
      Thank you
       
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.