Hi Sylvian,

After making your sample work, I've tested this
with CA-Cl*pper 5.2e, and it doesn't update the
second GET either. In Clipper :varPut() will never
modify :changed, in fact :varPut() will do nothing
else than updating the variable with the current
GET value.

To me it seems that Harbour is compatible with Clipper.

Code:
--
FUNCTION MAIN()
   LOCAL GetList := {}
   LOCAL lnDept  := 0
   LOCAL lnTax   := 0

@ 1, 0 GET lnDept PICTURE "999" VALID PickDept( GetList, @lnDept ) .AND. UpdTax( GetList, lnDept )
   @  2, 0 GET lnTax  PICTURE "9"

   READ

   o := _GET_( lnDept, "lnDept" )
   o:VarPut( 20 )
   ? o:Changed
   Inkey( 0 )

   RETURN NIL

FUNCTION PickDept( poGetList, lnDept )

   lnDept := 5 // ; Let's update this as if the user did it.

   poGetList[ 1 ]:VarPut( lnDept )
   poGetList[ 1 ]:Display()

   RETURN .T.

FUNCTION UpdTax( poGetList, pnDept )

   IF poGetList[ 1 ]:Changed
      poGetList[ 2 ]:VarPut( 9 )
   ENDIF

   RETURN .T.
--

Brgds,
Viktor

On 2008.06.21., at 20:00, Sylvain Larche wrote:

I was testing new update to my software and notice the following

Here is a simplified piece of my code this is not a working code
but should demonstrated the code of the problem.

FUNCTION EditItem()

 LOCAL GetList AS ARRAY   := {}
 LOCAL lnDept  AS NUMERIC := 0
 LOCAL lnTax   AS NUMERIC := 0

 @ 1, 0 GET     lnDept                                        ;
            PICTURE "999"                                       ;
            VALID   PickDept( GetList, lnDept ) .AND. ;
                       UpdTax( GetList, lnDept )

 @ 2, 0 GET     lnTax                             ;
        PICTURE "9"

 READ

RETURN( NIL )

FUNCTION PickDept( poGetList AS OBJECT, pnDept AS NUMERIC )

 // Tbrowse to pick a dept

 // if we select a dept then do the following

 lnPos := 2 // 2nd field in the getlist TAX

 poGetList[ lnPos ]:VarPut( lnDept )
 poGetList[ lnPos ]:Display()

RETURN( .T. )

FUNCTION UpdTax( poGetList AS OBJECT, pnDept AS NUMERIC  )
 LOCAL loPosDept AS NUMERIC := 1
 LOCAL lnPosTax  AS NUMERIC := 2

 // If we change dept then update tax info and other....
 IF poGetList[ lnPosDept ]:Changed

    DB_DEPT->( dbSeekByTag( pnDept, "Dept" ) )

    poGetList[ lnPosTax  ]:VarPut( DB_DEPT->nTax )

 ENDIF

RETURN( .T. )

Now the problem is that poGetList[ lnPosDept ]:Changed is never .T.
when
a VarPut() is done so my tax Get is never updated

If we add in TGet method Varput a ::Changed := .T. this should fix the
problem.

*Sylvain **Larche*
Iosys Technologie
io... <http://groups.google.com/groups/unlock?msg=5d5364d8398f54f6&_done=/group/comp.lang.xharbour/browse_thread/thread/ed47e32740e722ce/915f1034b7a88ba2%3Flnk%3Dgst%26q%3Dsylvain%2Blarche >@videotron.ca
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to