Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Using OR operator in a do loop

1. ## Using OR operator in a do loop

Can you use a Or operator in a do loop

for example:
do this command
if browser().Page().Image("A").exist or browser().Page().Image("B").exist then
exit do
end if
loop

is that the correct logic???

2. ## Re: Using OR operator in a do loop

To make it simpler use this way:

Do Until browser().Page().Image("A").exist or browser().Page().Image("B").exist
'Do Something
Loop

<font class="small">Code:</font><hr /><pre>x = 1
y = 1
Do until x = 10 or y = 5
x = x + 1
y = y + 1
Loop </pre><hr />

3. ## Re: Using OR operator in a do loop

You could also use this way.

<font class="small">Code:</font><hr /><pre> x = 1
y = 1
Do
If x = 5 or y = 10 Then
Exit Do
End If
x = x + 1
y = y + 1
Loop </pre><hr />

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:51 PM.

Copyright BetaSoft Inc.