Run time error with database object

Post Reply
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Run time error with database object

Post 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
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post 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
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Post 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 ]
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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 ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Post 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:
Post Reply