>Here is the situation that I have:
>
>
>SET ORDER TO gd_key
>DO WHILE SEEK(SUBSTR(revall.vi_key,1,1)+revall.vi_vouchnm+SUBSTR(revall.vi_key,12,25))
> REPLACE iagdtail.gd_chknum WITH ALLTRIM(STR(VAL(RIGHT(revall.new_chk,9)))) ;
> iagdtail.gd_trandte WITH Thisform.r_cdate,;
> iagdtail.gd_key WITH LEFT(iagdtail.gd_key,1) + ALLTRIM(revall.new_chk) + iagdtail.gd_fundcod + DTOC(Thisform.r_cdate) +RIGHT(iagdtail.gd_key,1) ;
> iagdtail.gd_trannum WITH ALLTRIM(revall.new_chk)
>
> TABLEUPDATE(.F., .F., "IAGDTAIL")
>ENDDO()
>
>
>The problem is that when revall.new_chk is the same as iagdtail.gd_chknum of a different record. Let say the following is sample data
>
>gd_chknum new_chk
> 222 223
> 223 224
> 224 225
>
>The first record works fine. But when I am working on the second records there are twice as many records that fir the criteria because I change the records for the first record.
>
>How do I avoid eeing the records that were already changes when processing the second and third records?
>
>Thank you
Christine,
Set the order to anything but one that changes (or may change) the order
set order to
scan all for ...
replace ...
endscan
Gregory