I think that would do it, yes. (unless I needed the value of outer to be preserved for a starting condition for next time--and I think that was the case here. I was hoping to return to coding today, but that's apparently not going to happen. I think that the loops were about looking for something long term [i.e. past many iterations lf loop()] to do when none were being done {sprinkler controller that still needed to be able to talk over bluetooth, so I wouldn't want to start at the beginning of the search, either, as there could be times when an early unit had multiple pending runs in the queue, but I want the whole program to execute first}. )
I tend to be less than positive whether the language that I'm using at any given moment tests at the top or bottom of loops, and code so that I don't need an assumption about this.
But I definitely need to remember this approach . . .
But I definitely need to remember this approach . . .
Don't bet your family fortune on it until others have commented. I have a nasty feeling that it may be regarded as bad practice for one reason or another
tend to be less than positive whether the language that I'm using at any given moment tests at the top or bottom of loops, and code so that I don't need an assumption about this.
That's easy because a for loop in C is the equivalent of a while loop and the exit condition is tested at the start of the loop
UKHeliBob:
Don't bet your family fortune on it until others have commented. I have a nasty feeling that it may be regarded as bad practice for one reason or another
Good point. And arduino_new may have one of those . . . come to think of it, is altering a control variable a defined behavior in C? I know that I've used languages where it is not, and can do strange things, or is permitted to, or . . .
UKHeliBob:
That's easy because a for loop in C is the equivalent of a while loop and the exit condition is tested at the start of the loop
Over the course of a typical day, I'm likely using LiveCode, Arduino C++, shell scripts, Python, raw or and/or automated manipulation of postscript or pdf, and shell script. I try to write in a way that won't backfire if I mix'n'match quirks [ok, "forget which I'm using"]
All in all, it the present example, it still seems that the GOTO is the cleanest and least resource intensive. But the Fortran style exit would are even better . . .