FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Run time error with database object
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Run time error with database object
Posted: Mon Mar 03, 2008 05:04 AM
This is the reduced sample:
#include "FiveWin.ch"

function Main()

   local oDlg, oGet1, oGet2, n1 := 0, n2 := 1, oDbf

   dbCreate("Test", {{"modified","c",1,0}})
   use test new exclusive

   database oDbf

   DEFINE DIALOG oDlg TITLE "Testing Gets"

   @ 1, 1 GET oGet1 VAR oDbf:modified picture "Y"


   @ 3, 11 BUTTON "Ok" ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

return nil


The error will happen when the value of the field is changed.

Using FWH8.02 with xHarbour binary of Feb 08 compiled by Antonio.

Can anyone help?

TIA
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Run time error with database object
Posted: Mon Mar 03, 2008 07:47 AM

Hua,

the name 'modified' might conflict with the tData:modified() method.
Perhaps an other name for your field could solve your problem?

hth,
Detlef

Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Run time error with database object
Posted: Mon Mar 03, 2008 09:39 AM
Thanks Detlef :-) Yes, it's because of the conflict between "modified()" and ":modified". Renaming the field does solve the problem and that's what I've implemented so far as a temporary workaround.

However, I was kinda hoping that the root cause, which is the inability to differentiate between oDbf:modified() and oDBf:modified, itself could be addressed.

BTW Antonio, I think one of the line in :modified() should be changed from: if ! ( ::cAlias )->( FieldGet( n ) ) == ::aBuffer[ n ]

to:

if ! ( ::nArea )->( FieldGet( n ) ) == ::aBuffer[ n ]
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Run time error with database object
Posted: Mon Mar 03, 2008 06:17 PM

Hua,

>
the inability to differentiate between oDbf:modified() and oDBf:modified, itself could be addressed.
>

We can't differentiate them cause the object oriented engine implementation of Clipper/Harbour.

>
BTW Antonio, I think one of the line in :modified() should be changed from: if ! ( ::cAlias )->( FieldGet( n ) ) == ::aBuffer[ n ]

to:

if ! ( ::nArea )->( FieldGet( n ) ) == ::aBuffer[ n ]
>

Its the same if we use ::cAlias or ::nArea, isn't it ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Run time error with database object
Posted: Tue Mar 04, 2008 01:30 AM
Antonio Linares wrote:
>
BTW Antonio, I think one of the line in :modified() should be changed from: if ! ( ::cAlias )->( FieldGet( n ) ) == ::aBuffer[ n ]

to:

if ! ( ::nArea )->( FieldGet( n ) ) == ::aBuffer[ n ]
>

Its the same if we use ::cAlias or ::nArea, isn't it ?


Now that I ponder on it further, yes it does. My bad, sorry for the false alarm :-)
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour

Continue the discussion