Programming-Idioms

History of Idiom 42 > diff from v11 to v12

Edit summary for version 12 :

Version 11

2015-08-21, 23:19:25

Version 12

2015-08-23, 00:03:48

Idiom #42 Continue outer loop

Print each item v of list a which in not contained in list b.
For this, write an outer loop to iterate on a and an inner loop to iterate on b.

Idiom #42 Continue outer loop

Print each item v of list a which in not contained in list b.
For this, write an outer loop to iterate on a and an inner loop to iterate on b.

Code
  for v in a do
    begin
      for  w in b do
        if (v = w) then
          break;
      if (v = w) then
        Continue;
      writeln(v);
    end;              
Comments bubble
You have to break the inner loop first, before you can continue the outer loop.