repeat and/or

I am using a repeat statement to loop while one or another image is present on the screen
repeat while imagefound(1) OR imagefound(2)
   do something
end repeat

I notice that even though image(1) is found the script still checks if image(2) is found. This slows the script down. I believe in most scripting languages if the first condition of an OR statement is true the system does not check the 2nd condition.

Is this true in Eggplant? If so what am I missing?

Thanks in advance,


  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    In SenseTalk, the standard "and" and "or" operators do NOT "short-circuit" like they do in some other languages, so both conditions will always be evaluated with those operators. However, special "short-circuit" versions are available -- just use "and if" or "or if" instead:
    repeat while imagefound(1) OR IF imagefound(2) 
       do something 
    end repeat
  • Thanks!
Sign In or Register to comment.