Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Thread: Start code again?

    by Norm
    Replies
    12
    Views
    8,488

    Re: Start code again?

    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)
  2. Thread: Start code again?

    by Norm
    Replies
    12
    Views
    8,488

    Re: Start code again?

    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...
  3. Thread: Start code again?

    by Norm
    Replies
    12
    Views
    8,488

    Re: Start code again?

    fist line would be the while(true) {

    // then lines of tests with continue when test fails

    } // end of while(true)
  4. Thread: Start code again?

    by Norm
    Replies
    12
    Views
    8,488

    Re: Start code again?

    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...
  5. Thread: Start code again?

    by Norm
    Replies
    12
    Views
    8,488

    Re: Start code again?

    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...
  6. Thread: Start code again?

    by Norm
    Replies
    12
    Views
    8,488

    Re: Start code again?

    If the tests are in a while(true) loop, issue a continue; to start at the beginning of the loop.
Results 1 to 6 of 6