Run time error with database object

Run time error with database object

Postby hua » Mon Mar 03, 2008 5:04 am

This is the reduced sample:
Code: Select all  Expand view  RUN
#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
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Postby Detlef Hoefner » Mon Mar 03, 2008 7: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
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby hua » Mon Mar 03, 2008 9: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 ]
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Postby Antonio Linares » Mon Mar 03, 2008 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby hua » Tue Mar 04, 2008 1: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 :oops:
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to FiveWin for Harbour/xHarbour

Who is online

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