continue

Java String initialization (part 2)

I asked this goofy question earlier today and got good answers. I think what I really meant to ask is the following: String aString = ""; // Or = null ? if(someCondition) aString = "something"; return aString; In this case, the string has to be initialized in order to return it. I always thought that either option (setting it to "...

C#: Nested conditionals vs continue statement

In using ReSharper recently, it is suggesting I reduce nesting in certain places by inverting if conditions and using the continue statements. nested conditionals: foreach(....) { if(SomeCondition) { //do some things if(SomeOtherNestedCondition) { //do some further things } } } ...

Can I skip an indeterminate amount of steps for an enclosing loop? (Python)

This is perhaps a result of bad design, but here it goes. I wasn't quite sure how to explain this problem. So I have code that iterates over a list of words. (This list does not change.) The code then parses and combines certain words together, depending on a set of criteria, storing them in a new list. The master loop, which is taking ...

Python - Way to restart a for loop, similar to "continue" for while loops?

Basically, I need a way to return control to the beginning of a for loop and actually restart the entire iteration process after taking an action if a certain condition is met. What I'm trying to do is this: for index, item in enumerate(list2): if item == '||' and list2[index-1] == '||': del list2[index] *<some ...

MySQL: DECLARE CONTINUE HANDLER to continue on errors, printing a warning

I am reviewing / redesigning / refactoring a database and want to create a new database that stores pretty much the same data in a smarter fashion. One of the problems in the 'legacy' database is that it does not make proper use of keys and indices, so there is duplicate entries where there should be none. I have written a python script...

Edit-and-continue only works on some classes in my VS 2008 project

I have a very strange problem. In my quite large project I have an extensive backend library of classes all belonging to the same Assembly. When I run the code Edit and Continue works fine in all forms and files belonging to the UI, but when I attempt to edit a class I get the "Cannot currently modify this text in the editor. It is read-...

Looping through several functions in PHP

Hello, Basically I want to achieve such functionality that 5-10 functions are executed in a row (like normally). However, I want the script to go back several steps back (ex. from 5th back to 3rd) and continue further (like 4,5,6,7,8,9,10), if specific return is received. Example: <? function_1st(); function_2nd(); function_3rd(); funct...

Java Loop Efficiency. if-continue OR if

Hi. The question being thought today while completing my task is about the loop efficiency.. Lets say. I have an array {'a','x','a','a'} And a loop that should avoid 'x' element Now i wonder how these two approach differ in term of efficiency - not taking the while or do-while or for loops differentiation char[] arrExample = {'a','x'...

"Continue" (to next iteration) on VBScript

A colleague and I were trying to figure out a way of doing the equivalent of a "continue" statement within a VBScript "For/Next" loop. Everywhere we looked we found people had no way to do this in VBScript without having nasty nestings, which is not an option for us since it is a quite big loop. We came out with this idea. Would it wor...

Equivalent of "continue" in Ruby

In C and many other languages, there is a continue keyword that, when used inside of a loop, jumps to the next iteration of the loop. Is there any equivalent of this continue keyword in Ruby? Thanks in advance! ...

Exception propagation through nested loops/calls

I'm having trouble understanding how exceptions should propagate. My code (quite similar to the generic code below) executes otherCode() and fails to continue outer when doSomething() throws the exception. I need to loop over parsing a bunch of files, some of which may be formated incorrectly (causing an exception), and then loop over ...