break bug
- Posted by bryanso Nov 08, 2012
- 1423 views
Why doesn't this break command break out of the "for i" loop?
procedure f() for i = 1 to 5 do printf(1, "i is %d\n", i) if i = 3 then for j = 1 to 5 do printf(1, " j is %d\n", j) end for break end if end for end procedure f()
Result:
i is 1 i is 2 i is 3 j is 1 j is 2 j is 3 j is 4 j is 5 i is 4 i is 5