I understood I have aItems of 18 field and citemflds of 19
How I can make to set aItems to 19 fields ?
today problem with savetodbf
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: today problem with savetodbf
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
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
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: today problem with savetodbf
Otto wrote:'Silvio,
but before you can save a record you have to navigate to the recNo
METHOD GoTo( nRecNo )
or insert a new record.
METHOD Append()
Why don't you create a function, SAVE () and pass your data?
There you open your database again and save everything.
And then closes it.
For such a complicated task, this is more transparent.
And more secure. Commit, skip problems. More save in network enviroment.
Best regards,
Otto
after i can do everything, first i solve this problem
in the yunus.prg program Nages adds a field to aBlankItem
i have the array differently and i don't know how to add the field
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
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
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: today problem with savetodbf
Perhaps I found a solution
I add on dbf Rig_Res a field recno numeric 3cr
when I add a new service I add a new field
now the fields are 19
the I save with oRigheInvoice:ArrayToDBF( aData, cItemFlds,, .t., .t. ) and seem to run
Now I must make the edit procedure
I add on dbf Rig_Res a field recno numeric 3cr
when I add a new service I add a new field
Code: Select all | Expand
AaDd(oBrowse:aArrayData,{ ".\bitmaps\servizio.png" ,;
"01" ,;
"servizio" ,;
1 ,;
9 ,;
9 ,;
,;
,;
,;
0 ,;
0 ,;
nInvoice ,;
.t. ,;
.t.,;
"",;
"",;
1 ,;
0,0} )
now the fields are 19
the I save with oRigheInvoice:ArrayToDBF( aData, cItemFlds,, .t., .t. ) and seem to run
Now I must make the edit procedure
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
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
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: today problem with savetodbf
Otto,
making the modifies this afyernoon perhaps it can run
the new record is ok
the modify record is ok
I have problems when I delete a row
on xbrowse of yunus it delete with
I insert a button at xbrowse with
this seem be not the same
when I save the rows
I use this
If I use my method not run ok
in fact it does not delete (on dbf) the lines that I have deleted on xbrowse
making the modifies this afyernoon perhaps it can run
the new record is ok
the modify record is ok
I have problems when I delete a row
on xbrowse of yunus it delete with
Code: Select all | Expand
:bKeyDown := { |k| If( k == VK_DELETE, ( oBrowse:aAppend := nil, oBrowse:Delete(), 0 ), nil ) }
I insert a button at xbrowse with
Code: Select all | Expand
WITH OBJECT oBrowse:aCols[ 12]
:AddBitmap({"delete.bmp","broom.png"})
:nBtnBmp := 1
:lBmpStretch := .F.
:lBmpTransparent := .T.
:nwidth := 30
:nEditType := EDIT_BUTTON
:bEditBlock := { || oBrowse:Delete() }
:nHeadBmpNo := 2
:cHeader := ""
END
this seem be not the same
when I save the rows
I use this
Code: Select all | Expand
if ! Empty( oBrowse:aDeleted )
AEval( oBrowse:aDeleted, { |a| a[ 18 ] := -a[ 18 ] } )
oRigheInvoice:SaveArrayToDBF( cItemFlds,oBrowse:aDeleted ) // save the delete records
endif
If I use my method not run ok
in fact it does not delete (on dbf) the lines that I have deleted on xbrowse
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
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
- Silvio.Falconi
- Posts: 7133
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: today problem with savetodbf
OK NOW RUN OK
I AM HAPPY
Code: Select all | Expand
if ! Empty( oBrowse:aDeleted )
AEval( oBrowse:aDeleted, { |a| a[ 19 ] := -a[ 19 ] } )
oRigheInvoice:SaveArrayToDBF( cItemFlds,oBrowse:aDeleted ) // save the delete records
endif
I AM HAPPY
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
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