1. ## How to Skip to the Next Iteration of a Loop

Hi,
I am looking for a keyword/Statement which is equavelant to "Continue" in VB. here is the structure of my code.

For i=1 to N

IF "XX" THEN(First If)
END IF

IF "YY" THEN(Second If)
END IF

IF "ZZ" THEN(Third If)
END IF

Next

Now if condition for "First If" is true, the code should not execute "Second If" and "Third If". and move to next iteration without exiting the FOR LOOP.

same way in second iteration if condition for "first If" is False and "Second If" is True, it should skip "Third If".

2. ## Re: How to Skip to the Next Iteration of a Loop

For i=1 to N

IF "XX" THEN(First If)
ELSE

IF "YY" THEN(Second If)
ELSE

IF "ZZ" THEN(Third If)
END IF

END IF

EnD IF

Next

3. ## Re: How to Skip to the Next Iteration of a Loop

hi eriktv3,
Thanks for the reply, but actually i am not looking for this option, i just wanted to convey my problem through the above structure. I am sorry if have not conveyed it properly. my problem is entirely diffenrent.

actually i am looking for some statemnt like "Continue" which we use in VB.

4. ## Re: How to Skip to the Next Iteration of a Loop

There is no "continue" in VBScript. Perhaps describe your actual problem, because you have a valid answer for the problem you have described.

5. ## Re: How to Skip to the Next Iteration of a Loop

Azaz,

You could emply flag variables.

6. ## Re: How to Skip to the Next Iteration of a Loop

hi Turbografx,
I wrote "VB" not "VB script".

http://msdn.microsoft.com/en-us/libr...aa(VS.80).aspx

Same "Continue" i am looking for in QTP.

i Cant explain the actual problem here as it will take lot of space and time.

kindly see the link and let me kknow if we have such thing available in QTP

7. ## Re: How to Skip to the Next Iteration of a Loop

Azaz - QTP uses VBScript.

If you can't explain the problem, I'm not sure how you expect someone to give you an answer.

Perhaps do a google search on "continue VBScript".

8. ## Re: How to Skip to the Next Iteration of a Loop

You can use Switch case for your scenario i hope...

9. ## Re: How to Skip to the Next Iteration of a Loop

hey there isn't any continue statement in the vb script but you can use trick like following to skip the loop iteration
<font class="small">Code:</font><hr /><pre>
For i=0 to 10
Do while true
If i mod 2 =0 Then
msgbox "even"
Exit do ' to skip the iteration.
else
Exit do
End If
Loop
Next </pre><hr />

see if it works...

10. ## Re: How to Skip to the Next Iteration of a Loop

Thanks Guyz for all your inputs. i just wanted to know if we have such facility in VBScript

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.