likecoding Posted December 4, 2017 Share Posted December 4, 2017 Hi, For i = 1 to 5 ' do somthing For j = 1 to 5 ' do something if a = b then exit for end if Next Next '' continue here I have two for loops. If a = b how can I exit out from both loops so it will continue from the line says "continue here" ?Currently, it exits out of inner loop only. Thanks. Link to comment Share on other sites More sharing options...
justsomeguy Posted December 5, 2017 Share Posted December 5, 2017 I don't know if that statement takes any other value to tell it how many levels to exit, but if not then can set a variable before you exit that you can check in the outer loop to see whether or not to exit. That's a little confusing though and suggests that there's a more efficient way to design what you're trying to do. Link to comment Share on other sites More sharing options...
likecoding Posted December 5, 2017 Author Share Posted December 5, 2017 I used variable for outer loop. Now it works. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now