Question: Problem with error in for loop

Hey guys,

I have a problem with this code:

d := Array(1 .. 15);

for i to s1 do

for c2 to 15 do

if `mod`(c2+(J+H)*(`mod`(1/(H+1), A[i])), A[i]) = 0 then d[c2] := d[c2]+l(A[i]) else d[c2] := d[c2]end if

end do

end do;

d;

The problem is that my code stops running when I encounter that `mod`(1/(H+1), A[i]) doesn`t have an modular inverse. What I would like to have is that the loop just continues and does nothing when my array when it encounters an error.

Hope you can help me!

Please Wait...