while (true) {
if(!test1_OK)
continue; // go back to start
if(!test2_OK)
continue; // go back to start
// all tests ok
break; // exit loop
} // end while(true)
Type: Posts; User: Norm
while (true) {
if(!test1_OK)
continue; // go back to start
if(!test2_OK)
continue; // go back to start
// all tests ok
break; // exit loop
} // end while(true)
What does your book say about the while statement? What goes in the () following the while? a Condition. What is a condition: an expression that evaluates to true or false. true is an expression...
fist line would be the while(true) {
// then lines of tests with continue when test fails
} // end of while(true)
That logic looks like it'd fit in a while(true) loop.
The code in the loop would continue to the next test as each test passed.
When a test failed, use the continue statement to start at the...
Where in the code do you go to start again? What are the all the steps that you are doing? Where in that list of steps do you want to go to start again?
I thought your code was to test field1 then...
If the tests are in a while(true) loop, issue a continue; to start at the beginning of the loop.