I have to re-insert data from an array onto a data store. I state I opened the dbf with Tdatabase.
These are many records.
For example, as a first configuration I want to try with 450 records.
Since I opened and indexed with the "For! Deleted ()" clause I should first delete them all and then use the "FW_ArrayToDBF" function to reinsert them all.
recalling the deleted records but I do not know how to do it.
Nages had written to me privately that he sang me as I could recall a deleted record
To save my record I made :
the function of save record first go to function Controllo to see if there are errors on array
FUNCTION SaveConfig(lMessaggio)
Local nY, nX
Local lErrore := .f.
Local nprogress := 0
Local aTempDbf:={}
IF lMessaggio
lErrore:= Controllo()
Endif
IF !lErrore
Ut_ResetMeter( oProgressDlg, nprogress ) // reset the control Meter
// to simulate db_zap I must erase all records
oSpiaggia:Gotop()
Do While .not. oSpiaggia:eof()
oSpiaggia:delete()
oSpiaggia:skip()
EndDo
oSpiaggia:Gotop()
// save on in un array temporaneo
For nY := 1 to TOTY
For nX := 1 To TOTX
nRow:=nX
nCol:=nY
cElemento:=aData[nY,nX]
cLibero:=strzero(recno(),5)
//----------------------------------------------------------------------------------//
Now I save all data into a temporaney array aTempDbf I have info data in different other arrays
//-------------------------------------------------------------------------------------//
For n= 1 to Len(aElementi)
IF aData[nY,nX] == aElementi[n][3]
IF aElementi[n][6] == TRUE //attivo
nCamera:= Iif(!empty(aNumeri[nY,nX]),aNumeri[nY,nX],0)
cSettore:=Iif(!empty( aSettori[nY,nX]),aSettori[nY,nX],"")
cDesc:=aElementi[n][4]
lactive:= TRUE
else
cDesc:=aElementi[n][4]
ENDIF
elseif aData[nY,nX] =="X"
cDesc:="spazio vuoto"
Endif
next n
AaDD( aTempDbf,{nCamera,nRow,nCol,cElemento,cDesc,,strzero(recno(),5),cSettore,lActive})
next nX
next nY
//----------------------------------------------------------------------------------//
Now I must save on dbf from array with recal delete
//-------------------------------------------------------------------------------------//
cFieldList:="camera,x,y,Id,Desc,Stato,Libero1,settore,active"
oSpiaggia:FW_ArrayToDBF(aTempDbf, cfieldlist,,.t., .t., )
but it make error, add to dbf but not recall the records
the red records are deleted()
I use 19.01 fwh