Comment Re:COBOL WHILE loops (Score 1) 729
This seems perfectly logical to me. There's nothing about "UNTIL" that implies that condition will be tested after the loop - the only meaning that the word carries is the negation of the condition. I suspect that this confusion comes from Pascal, where "repeat
while condition do staement;
repeat statement until condition;
In your example, "perform until condition" comes before "statements", so it makes perfect sense to check the condition first.
The best syntax for such loops was actually in MS dialects of BASIC (QBasic, VB etc) - it had WHILE, UNTIL and pre- and post-conditions in all the possible combinations, as well as infinite loop, all syntactically uniform and very obvious:
DO
..
LOOP
DO WHILE condition..
LOOP
DO UNTIL condition..
LOOP
DO..
LOOP WHILE condition
DO..
LOOP UNTIL condition