Updating a variable during a GET

Updating a variable during a GET

Postby HunterEC » Sat Dec 25, 2010 9:59 pm

Guys:

In this piece of code:
Code: Select all  Expand view
@ 10,45 GET oGets[1] VAR adDates[1]        OF oDlg SIZE 40,10 PIXEL ;
              PICTURE "D" CENTER ;
              VALID EVAL({|| adDates[2] := adDates[1], .T.})
          @ 25,45 GET oGets[2] VAR adDates[2]        OF oDlg SIZE 40,10 PIXEL ;
              PICTURE "D" CENTER
          @ 40,45 GET oGets[3] VAR anRxs[1]          OF oDlg SIZE 25,10 PIXEL ;
              PICTURE "@Z 9999999" VALID anRxs[1] >= 0 RIGHT
 


When I get to the second GET (adDates[2]) it do not show the updated field. After going to the
third get and going back to the second get (adDates[2]), the field shows the new value.

What I'm doing wrong ?

Thank you.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Updating a variable during a GET

Postby kok joek hoa » Sun Dec 26, 2010 7:40 am

Dear HunterEC,

Try this :


Code: Select all  Expand view
@ 10,45 GET oGets[1] VAR adDates[1]        OF oDlg SIZE 40,10 PIXEL ;
              PICTURE "D" CENTER ;
              VALID  ( adDates[2] := adDates[1] ,;
                       oGets[2]:varget()        ,;
                       oGets[2]:refresh()       ,;
                       .T.                       ;
                     )  
       
        @ 25,45 GET oGets[2] VAR adDates[2]        OF oDlg SIZE 40,10 PIXEL ;
              PICTURE "D" CENTER

        @ 40,45 GET oGets[3] VAR anRxs[1]          OF oDlg SIZE 25,10 PIXEL ;
              PICTURE "@Z 9999999" VALID anRxs[1] >= 0 RIGHT
 




regards,

Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: Updating a variable during a GET

Postby HunterEC » Sun Dec 26, 2010 8:08 am

Kok:

Thank you very much. It worked as expected.

Gustavo
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Updating a variable during a GET

Postby James Bott » Wed Dec 29, 2010 6:48 pm

Or, you can use the UPDATE clause on all your GETs.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests