Thanks for that Doug - I have sent you an email regarding the specifics of that problem.
However, the second, similar problem I mentioned was not knowing how to stop a for-loop when a definition within that for-loop reached a specific value, take for example the loop below, how do I get it to stop when a[i+1]=0. I don't know which iteration (or i) this will be on, I just know that I need the for-loop to stop when a[i+1]=0.
for i from 0 to 2 do
and x[i+1] will be given.
Any ideas are greatfully received.
Thanks in advance.