Page 1 of 1

Run time error with database object

Posted: Mon Mar 03, 2008 5:04 am
by hua
This is the reduced sample:

Code: Select all

#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

Posted: Mon Mar 03, 2008 7:47 am
by Detlef Hoefner
Hua,

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

hth,
Detlef

Posted: Mon Mar 03, 2008 9:39 am
by hua
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 ]

Posted: Mon Mar 03, 2008 6:17 pm
by Antonio Linares
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 ?

Posted: Tue Mar 04, 2008 1:30 am
by hua
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 :oops: