break bug

new topic     » topic index » view thread      » older message » newer message

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 

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu