I set up a simple loop similar to your own to see if I encountered the same problem:
set k 1;
set r 5;
set hit false;
do while < #k #r and not #hit:
echo #k #r #hit;
dec r;
set hit true;
loop;
This looped only once. I changed what hit is set to to "e1" and got the same result. So, the problem does not seem to be with the logic of the looping condition. Has any of the subroutines you called changed the value of k or r?
I set up a simple loop similar to your own to see if I encountered the same problem:
This looped only once. I changed what hit is set to to "e1" and got the same result. So, the problem does not seem to be with the logic of the looping condition. Has any of the subroutines you called changed the value of k or r?