To check which elements are not necessary I have to compare if two items of an array (adata) previously loaded are the same in the archive.
If in the archive a record has the contents of two fields that are not equal to the items of aData must be deleted.
I made this test but it not found that I wish
Function Trova_tariffe_inutili(cDir,adata)
Local oTariffe
Local n
Local cIdElemento
Local cSettore
Local lyes:= .f.
Local atemp:={}
xbrowser aData
For n= 1 to Len(adata)
cIdElemento:= aData [n][2]
cSettore := aData [n][4]
oTariffe:=TDatabase():Open( , cDir+"TARIFFE", "DBFCDX", .T. )
oTariffe:SetOrder( 1 )
oTariffe:GoTop()
Do while .not. oTariffe:eof()
IF oTariffe:Tasettore==cSettore .and. oTariffe:TaElemento=cIdElemento
else
aadd(atemp,{oTariffe:TaElemento,oTariffe:Tasettore} )
Endif
oTariffe:skip()
Enddo
oTariffe:close()
cSettore:=""
next
xbrowser atemp
return nilon aData I have these items

on archive Tariffe.dbf I have these records

so the procedure must search only the two records

because tasettore = "I" and tasettore ="F" on adata not exit
How I can resolve it ?
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com


