I have had a similar problem. Add "SELECT TABLE1" just before "LOOP".
>Hi all.
>I have a few lines of code like this:
>SELECT TABLE1
>GO TOP
>xCOUNT=0
>SCAN FOR OWE <> 0
>STORE idSTD TO xidSTD
>SELECT TABLE2
>LOCATE FOR idSTD=xidSTD
>REPLACE OWE WITH TABLE1.OWE
>xCOUNT=xCOUNT+1
>LOOP
>EXIT
>ENDSCAN
>
>Problem is it keeps going into an endless loop, without exiting when the last match is found. What am I missing?
>
>TIA
>Ulises
Dennis Lindeman