Find and print the first string in a list:
>

L := [1, 2, "abc", "a", 7.0, infinity]:

>

for x in L do
if type(x, 'string') then
print(x);
break;
end if;
end do:

Print ordered pairs [1,1], [1,2], ..., [4,4], stopping after [2,3]:
>

for i to 4 do
for j to 4 do
print([i,j]);
if i = 2 and j = 3 then
break i; # alternatively, break 2;
end if;
end do;
end do:

$\left[{1}{\,}{1}\right]$
 
$\left[{1}{\,}{2}\right]$
 
$\left[{1}{\,}{3}\right]$
 
$\left[{1}{\,}{4}\right]$
 
$\left[{2}{\,}{1}\right]$
 
$\left[{2}{\,}{2}\right]$
 
$\left[{2}{\,}{3}\right]$
 (2) 
Print each row of a Matrix, stopping after the first row containing a zero.
>

A := LinearAlgebra:RandomMatrix(M,N):

$\left[\begin{array}{ccc}{\mathrm{32}}& {8}& {44}\\ {\mathrm{74}}& {0}& {92}\\ {\mathrm{4}}& {99}& {\mathrm{31}}\\ {27}& {29}& {67}\end{array}\right]$
 (3) 
>

for row to M do
print(A[row]);
for col to N do
break row if A[row,col] = 0;
end do;
end do:

$\left[\begin{array}{ccc}{\mathrm{32}}& {8}& {44}\end{array}\right]$
 
$\left[\begin{array}{ccc}{\mathrm{74}}& {0}& {92}\end{array}\right]$
 (4) 