4.20 Break

  • break;

    The statement break; causes an immediate exit from the innermost loop enclosing it. It is an error to use this statement other than inside a loop.

    gap> g := Group((1,2,3,4,5),(1,2)(3,4)(5,6));           
    Group([ (1,2,3,4,5), (1,2)(3,4)(5,6) ])
    gap> for x in g do
    > if Order(x) = 3 then
    > break; 
    > fi; od;
    gap> x;
    (1,4,3)(2,6,5)
    
    gap> break;
    A break statement can only appear inside a loop
    

    [Top] [Previous] [Up] [Next] [Index]

    GAP 4 manual
    February 2000