I am trying to replace a field called SEL with a flag ('Y') for up to the value in a matched field (IDcode). Everything seems to be working ok, but when the idcode changes I can not figure out where to clear my counter. Mental block here please help.
here is the code:
select Input
go top
scan while !eof()
*
*
if seek(Input.IDcode,"SelectCnt")
nSelQty = SelectCnt.Qty
Select SelectCnt
Do While SelectCnt.Idcode = Input.IDcode
IF nUpdates <= nSelQty
select Input
nUpdates = nUpdates +1
replace Input.Sel with 'Y'
select SelectCnt
Endif
skip
Enddo
Select Input
Endif
endscan
here is the code:
select Input
go top
scan while !eof()
*
*
if seek(Input.IDcode,"SelectCnt")
nSelQty = SelectCnt.Qty
Select SelectCnt
Do While SelectCnt.Idcode = Input.IDcode
IF nUpdates <= nSelQty
select Input
nUpdates = nUpdates +1
replace Input.Sel with 'Y'
select SelectCnt
Endif
skip
Enddo
Select Input
Endif
endscan