thanks, what a silly mistake. i didn't saw that, 
actually i think that i have not written the code properly as the program is taking too much time to process. Anyway thanks again for your help.
Actually, I wouldn't be surprised if it runs forever....
while equA<prob do
begin
z:=z2+0.0001;
end;
This is an endless loop, unless equA or prob are functions (part of a property) and there calculation includes z or z2
equA or prob are not modified in the loop....
And also, if z and z2 are variables, z2 does not change, so the result for z is always the same