Question: adaptive "for statement" (Urgent)

Hi, I'm trying for some time to create an adaptive procedure which modify the interval of the argument of a function depending on its values. The problem is that I still can't make the "if statement" to work the way I want it. The problem is that the cycle initiate some step "p" in the beginning and it use it trough the cycle although the value of the variable "p" already is different than the initial one. After printing it out, the interval changes with the initial value and the value of p changes independently. Which implies that Maple stores the initial value somewhere and use it from there, not from the immediate memory. If anyone has encountered such problem, please give me a hint how to solve it, because it is very important for me and I still have absolutely no idea what to do. I tried using the "for in" statement with some expression for the step, but it seems to work even worst. And answers would be appreciated.
Please Wait...