Question: Unterminated loop when using operator assignment

tot := 1:         
for z in 1, x, y, q^2, 3 do    
    tot += z;  
end do:  
tot;

When I run the code above, Maple gives me "Error, unterminated loop".

However, if I change the code to 

tot := 1;
for z in 1, x, y, q^2, 3 do
    tot := tot + z;
end do:
tot;

Maple computes the result correctly.

I don't see how the loop is unterminated. Am I not allowed to use operator assignments in loops?

Please Wait...