• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to continue a for loop after breaking?  RSS feed

 
antsi klando
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way to continue a for loop after breaking?

I want to implement the following:



Is there any way I can get this done?Please provide me a best suggestion.
 
Paul Clapham
Sheriff
Posts: 22829
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
antsi klando wrote:Is there any way to continue a for loop after breaking?


No, once you leave the loop there's no way to go back into it.

I want to implement the following:


And that's what you did. The code is a perfect implementation of itself, of course. You must have meant that you wanted to implement something else, but that code didn't implement that something else. So you would have to explain what that "something else" was.
 
antsi klando
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I know what is the best alternative to it?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37496
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
antsi klando wrote:Can I know what is the best alternative to it?

We don't understand what you want to do yet. Maybe you can explain it without the loop. For example, maybe you want to run

statement1;
statement2;
statement1;
statement2;
statement3;
statement1;
statement2;
statement3;
statement4;
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!