I'm not clear on the While Loop. Is it evaluated only at the beginning of each loop or continuously? If I'm evaluating a switch condition and I have five lines of conditional code following, will I possibly jump out after 2 or three lines are completed or is it always an integral number of times through the loop. I don't want to leave this block part way through an execution of this block.
Nope, as shown in the Arduino sketch below. There is seldom a reason to use labels or goto statements but they are legal C and C++ constructs.
void setup(){}
void loop()
{
boolean condition;
// In the form of a 'while' loop
while (condition)
{
statement1();
statement2();
statement3();
}
// The equivalent of a 'while' loop
label1:
if (!(condition)) goto label2;
statement1();
statement2();
statement3();
goto label1;
label2:;
}
void statement1(){}
void statement2(){}
void statement3(){}