Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


skip a loop

skip a loop

skip a loop

How to skip any loop?
For instance,

ans = 0
For i=Lbound(a) to UBound(a)
  if a(i) = "1" Then
     answer = answer + cint(a(i))

Or simply speaking, what is the vbscript equivalent of java-continue?  thanks

RE: skip a loop

You just did it. There isn't any equivalent, so you have to do it with conditionals, like you just showed. Instead of ??? you can use a comment, or you can invert the logic and leave off the else part.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.

RE: skip a loop

Exit For

RE: skip a loop

Exit For won't continue the loop, it will end it. That's not what the OP is looking for. They want a command that will skip the rest of the stuff inside the for loop and go back to the top of the loop. There is no syntactical reason to have such a command, you can easily do without it just as the OP demonstrated above. It's just for convenience. I'm surprised Java even has such a command, since it is otherwise such a strict language, and that kind of command violates a major precept of structured programming - one entry, one exit.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close