Recall records with FW_ArrayToDBF

Recall records with FW_ArrayToDBF

Postby Silvio.Falconi » Tue Feb 12, 2019 9:22 am

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

Image





//----------------------------------------------------------------------------------//
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

Image

the red records are deleted()
I use 19.01 fwh
Last edited by Silvio.Falconi on Tue Feb 12, 2019 9:47 am, edited 2 times in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: Recall records with FW_ArrayToDBF

Postby nageswaragunupudi » Tue Feb 12, 2019 9:41 am

There have been subsequent improvements.
You get the final version when you download FWH 1901.

I would also suggest you wait for sample programs that we are going to post in the forums, demonstrating the use.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Recall records with FW_ArrayToDBF

Postby Silvio.Falconi » Tue Feb 12, 2019 9:47 am

please revise my message
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: Recall records with FW_ArrayToDBF

Postby nageswaragunupudi » Tue Feb 12, 2019 10:27 am

oDbf:SetOrder( 0 )
oDbf:GoTop()
oDbf:ArrayToDBF( aData, cFieldList, nil, .t., .t. )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests