A simple option and standard programming practice is to have Do Until Loops as well as Do While Loops.
Not a big deal but I assume easy to implement and fairly standard fair in programming.
Regards,
Mark
Do Until Loop
- Steve
- Matrix Staff
- Posts: 3424
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: Do Until Loop
I'll add this to the list, but you can do this relatively easily now by negating the loop condition.
E.g. if you wanted to "loop until x > 5", you would write "loop while x <= 5".
Of course, this becomes more difficult when you have more complex conditions, but it is still possible:
"loop until (x > 5) && (y < 6)" would be "loop while (x <= 5) || (y >= 6)"
(NOTE: && = logical AND and || = logical OR).
E.g. if you wanted to "loop until x > 5", you would write "loop while x <= 5".
Of course, this becomes more difficult when you have more complex conditions, but it is still possible:
"loop until (x > 5) && (y < 6)" would be "loop while (x <= 5) || (y >= 6)"
(NOTE: && = logical AND and || = logical OR).