Going to the beginning of void loop ()

Trying to figure out how to implement "break" type statement in void loop () to no avail. "break" only works with "for" or "while". Below is a crude example.

I could write this differently (check for condition3 before each subsequent operation) but my code and number of conditions/sub-conditions is too long and this will make things even more complicated.

Is there a way to go straight to the beginning of void loop() if condition3.5 is met? thank you.

void loop() {

if condition1==true{}

if condition2==true{}

if condition3==true { //THIS IS UMBRELLA IF STATEMENT THAT HAS LONG LIST OF OPERATIONS.

operation3.1
condition3.2
operation3.3
condition3.4

if condition3.5==true {
condition3 = false; //THIS IS WHERE THE UMBRELLA CONDITION (CONDITION3) BECOMES FALSE AND THE SUBSEQUENT STEPS UNDER THIS OVERARCHING CONDITION SHOULDN'T TAKE PLACE. THIS IS WHERE THE CODE SHOULD GO TO THE BEGINNING OF VOID LOOP ()

break; //UNFORTUNATELY, break DOESN'T WORK SINCE THIS IS NOT for or while STATEMENT.
}

condition3.6
condition3.7
operation3.8
etc.
}
}
}

P.S. I searched this topic quite a bit but all the responses seem to focus on "stopping" void loop() but I am trying to just go straight to the beginning of void loop() and continue from there.

The hidden main() program calls loop() repeatedly, so there is no need to "go to the beginning of loop()". Just allow loop() to return normally.

go straight to the beginning of void loop() if condition3.5 is met

if (condition_is_true) return;

Hint: the keyword "void" in front of loop() means that the loop function does not return a parameter.

return;

Sorry, I am little dense today and beginner to the arduino/C+. I searched "return" but, based on my interpretation, it is in the context of function returning value (not interrupting current iteration of loop and going to the beginning of a loop). here is another way of asking the same question:

loop() {

1 condition, function, or operation
2 condition, function, or operation
3 condition //if this condition is true then jump back to the beginning of the loop and start from there (do not go through conditions 4, 5 or 6 this time).
4 condition, function, or operation
5 condition, function, or operation
6 condition, function, or operation
}

I could easily do this with lots of if statements but the program is fairly long with lots of different conditions in different points. So, it would be extremely helpful if there was a command to "jump out" of the current iteration of a loop and "jump in" at the beginning

After writing response above, I was able to find "return" command that does exactly what you described. Thank you.

A return command exits a function and returns control to the calling function.

A return command in loop() returns control to the hidden function main() which immediately calls loop() again - hence a return within loop() has the effect of bringing control back to the start of loop()

...R

So, it would be extremely helpful if there was a command to "jump out" of the current iteration of a loop and "jump in" at the beginning

You don't need to, that just happens anyway. When it gets to the end it goes back to the beginning, that's built in, that's why it's called 'loop()', the clue is in the word 'loop'.

PerryBebbington:
When it gets to the end it goes back to the beginning

But that's not what the op wants to do; they want to pop back to the top from half way down, if the conditions are such that that is desirable.

As Robin2 points out, a return part way down will make it go to main() and thence to the top of loop() as required.

The output from the code below demonstrates, by never printing "four":

byte counter = 0;

void setup()
{
  Serial.begin(9600);
  Serial.println("setup()...");
  Serial.println(".... testing *return* ....");
  Serial.println("setup() done");
} //setup

void loop()
{
  counter++;
  if (counter == 1) Serial.println("one");
  else if (counter == 2) Serial.println(" two");
  else if (counter == 3) Serial.println("  three");
  else if (counter == 4)
  {
    return;
    Serial.println("four");
  }
  else if (counter == 5) Serial.println("five");
  else if (counter == 6) Serial.println(" six");
  else while (1) {} //just to stop the screen
} //loop
one
 two
  three
five
 six

But that's not what the op wants to do; they want to pop back to the top from half way down, if the conditions are such that that is desirable.

Hmm, I read the OP's question several times and it seemed to me to be what they wanted. Oh well, as long as they are happy with the answers.

Yes, twinkleyan correctly understood my question (sorry if I was not quite clear). And, yes, "return" command worked perfectly for this.

I think it's a little bit strange, even if it works. If I had something like this (which hasn't actually ever happened to me...) to do, I would just put a conditional block around the code at the end. That would be a lot less obfuscated.

if condition3.5==true {
condition3 = false;
}
else {
condition3.6
condition3.7
operation3.8
etc.
}
}
}