SELECT *, 0 bl FROM "tb - 副本.dbf" INTO CURSOR tmp READWRITE
SELECT tmp
GO TOP
DO WHILE !EOF()
IF (a != 0) AND (a != fqbz)
nRecno = RECNO()
SCATTER TO arr
LOCATE FOR fqbz==arr[4] AND zcj==arr[2] AND a==0 AND bl==0
IF FOUND()
REPLACE fqbz WITH arr[3], bl WITH 1
GO nRecno
REPLACE fqbz WITH arr[4]
ELSE
GO nRecno
ENDIF
ENDIF
SKIP
ENDDO
GO TOP
BROWSE FOR (a != 0) AND (a != fqbz)
SELECT tmp
GO TOP
DO WHILE !EOF()
IF (a != 0) AND (a != fqbz)
nRecno = RECNO()
SCATTER TO arr
LOCATE FOR fqbz==arr[4] AND zcj==arr[2] AND a==0 AND bl==0
IF FOUND()
REPLACE fqbz WITH arr[3], bl WITH 1
GO nRecno
REPLACE fqbz WITH arr[4]
ELSE
GO nRecno
ENDIF
ENDIF
SKIP
ENDDO
GO TOP
BROWSE FOR (a != 0) AND (a != fqbz)