Question: How can I go out from two nested loops?

Hi,

I would like to know how can I go out from two nested loops. I tried with the command 'break', but it go out only from the one loop. For example,

for i from 0 to 10 do

for j from 0 to 10 do

for z from 0 to 10 do

p:=i*j*z;

if p<=40 then print(p)

else break fi;

od; od;

print("---------");

od;

 

when p>40 I need to go into "for loop with i", not into "for loop with j". I would like to break both 'j' and 'z' loops.

Thank you for the assistance.

 

Please Wait...