by nageswaragunupudi » Fri Jun 21, 2013 5:44 pm
I suppose you are using FWH13.05
For scatter/gather FWH provides two alternatives.
1. You can use Tdatabase class.
2. If you continue using DBF directly, you can use TDataRow class.
TDatabase class:
For the problem you pointed out in this post we have two alternatives.
(a) Call oDbf:Load() after calling oDbf:Save()
OR
(b) Make this modification in database.prg and link with your project.
Please go to line no 1049 in method Save()
Between "endif" in line 1049 and next "endif" in line 1050 insert a line
::Load()
TDataRow() class.
You may use normal DBFs
Instead of legacy scatter/gather functions
oRec := TDataRow():New( <cAlias> )
You can refer to fields of the DBF like
? oRec:<fieldname>
oRec:<fieldname> := NewVaue
You can also create dialogs with @ r,c GET oRec:Amount PICTURE ....
When finished you can all'
oRec:Save()
This will save the modified data in the same record.
Example:
USE CUSTOMER NEW SHARED ALIAS CUST
SKIP 10
oRec := TDataRow():New( "CUST" )
? oRec:Age
oRec:Age := 50
? oRec:Modified()
oRec:Save()
There is also a default simple edit dialog
oRec:Edit()
Regards
G. N. Rao.
Hyderabad, India