for(i,run(n)){breakif(x[i] < 0) .... } for(i,run(n)){for(j,run(m)){breakif(x[i,j] < 0, 2) ...}} |
breakif(Logical) is equivalent to if(Logical){break;} . breakif(Logical,n) is equivalent to if(Logical){break n;} . It is implemented as a pre-defined in-line macro. It can be used only inside a loop and n must not exceed the number of containing loops. Example: Cmd> for(i,run(length(x))){breakif(abs(x[i]) > 3)} computes the index i of the first element on vector x to exceed 3 in absolute value. See also topics 'break', 'breakall', 'next'.