Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Pascal

Idiom #78 "do while" loop

Execute a block once, then execute it again as long as boolean condition c is true.

repeat
  Something;
  SomethingElse;
until
  c;
repeat
  Something;
  SomethingElse;
until not c;

This is the correct implementation, it repeats the block until condition c is not true
loop
   stuff();
   if not c then
      exit;
   end if;
end loop;

New implementation...
< >
deleplace