;Example of bdbfs plugin file.
;Mark all non-unique (in current order) records as deleted.
;Uses also some elements of bdbfs visual interface.

#include clipper.ch
#include bdbfs.ch

LOCAL _ik, xVal, nRec, nDel
cCodePage:='cp866'
_ik:=IndexKey(0)

IF Empty(_ik)
	SHOW 'Table is not ordered'
ELSE
	nRec:=RECNO()
	nDel:=0
	GO TOP
	START SEARCH
	WHILE !EOF() .AND. CheckEsc()	//Esc=Abort
		xVal := &_ik
		SKIP
		IF xVal == &_ik .AND. !DELETED()
			nDel:=nDel+1
			DELETE
		ENDIF
	ENDWHILE
	END METER
	SHOW WITH BELL NTRIM(nDel)+' records deleted'
	GOTO nRec
ENDIF

DISABLE REOPEN
