two-condition loop

  • Thread starter Thread starter Jamie Martin
  • Start date Start date
J

Jamie Martin

I am getting input from a user. After stage 1, he must verify what he has
entered. After stage 2, he must also verify what he's entered. However, if
either stage has errors, he needs to start again from the beginning. I
cannot do this (I tried):

Do
<instructions>
Loop Until Condition1 = True
<instructions>
Loop Until Condition2 = True

I could do what I want with a GoTo, but I understand that is poor practice
because it makes one's code unfollowable. Is there another structure I can
use that will be equivalent to the above?
 
Jamie,

You seem to be saying that if the user does part 1 correctly, but muffs part
two, that he must start over with part 1. I think you're almost there.

Do
Do
Part 1 steps
Loop until Part1OK
Part 2 Steps
Loop until part2OK = True
 
That's exactly what I want. Thanks.

Earl Kiosterud said:
Jamie,

You seem to be saying that if the user does part 1 correctly, but muffs part
two, that he must start over with part 1. I think you're almost there.

Do
Do
Part 1 steps
Loop until Part1OK
Part 2 Steps
Loop until part2OK = True
 
Back
Top