oDbf:modified() no regresa a .F. después de guardar el reg.

oDbf:modified() no regresa a .F. después de guardar el reg.

Postby ellano » Thu Jun 20, 2013 6:03 pm

Tengo problemas con el uso de oDbf:modified()

¿Es posible que odbf:Modified() (ni oDbf:Updated() en su caso) no pase a .F. aún después de realizar oDbf:save() seguido de su correspondiente oDbf:Commit()?

Saludos
ellano
 
Posts: 107
Joined: Tue Sep 15, 2009 7:52 am

Re: oDbf:modified() no regresa a .F. después de guardar el reg.

Postby nageswaragunupudi » Fri Jun 21, 2013 6:02 am

Thanks for pointing this out.
Method Save() should have called ::Load().
We shall fix this in next version.

For now, please use this workaround:
After calling oDbf:Save(), please call oDbf:Load()
Regards

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

Re: oDbf:modified() no regresa a .F. después de guardar el reg.

Postby ellano » Fri Jun 21, 2013 5:26 pm

Then I should wait until your next release. It is impossible for me to do it that way since I have my own Scatter and Gather beside (and above) those provided by Odbf and it will be a nightmare to reload data and gather in my 230 variables anew (has to do with Dbase field limitations and I was forced to use memo fields to subdivide them in several ones for the problem at hand like in the good all days in assembler). :shock:
ellano
 
Posts: 107
Joined: Tue Sep 15, 2009 7:52 am

Re: oDbf:modified() no regresa a .F. después de guardar el reg.

Postby 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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: oDbf:modified() no regresa a .F. después de guardar el reg.

Postby ellano » Fri Jun 21, 2013 6:29 pm

Thanks for your prompt and extensive response. I suppose you mean between lines 1046 and 1047 (2 consecutive ENDIFs of method save() class Tdatabase)

Will try.
ellano
 
Posts: 107
Joined: Tue Sep 15, 2009 7:52 am

Re: oDbf:modified() no regresa a .F. después de guardar el reg.

Postby nageswaragunupudi » Fri Jun 21, 2013 6:32 pm

yes
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 81 guests