Page 1 of 1

fwh execute another function ?

Posted: Fri Aug 19, 2011 2:16 pm
by MdaSolution
why fwh execute the second function ?

I explain

if I have a datapicker as :

@ 2.9,2 DTPICKER oDate VAR dData OF oBar FONT ofontBig SIZE 180,32 UPDATE ;
ON CHANGE CHANGE_PLAN(dData,lNumeri)

fwh execute before the CHANGE_PLAN(dData,lNumeri) then when I click on this control sometimes execute CHANGE_PLAN(dData,lNumeri) and sometimes not execute the function .

on this function I refresh the button I created on principal function and order it for ddata or if lnumeri ( checkbox) is true.

why fwh execute the second function before ?

Re: fwh execute another function ?

Posted: Fri Aug 19, 2011 2:45 pm
by gkuhnert
MdaSolution,

if I understand you right, you wonder, why the change-codeblock is being evaluated on init of a TDatePick element?
That happens, because in the class TDatePick the method cText( uVal ) is being called on init. And in this method the method ::Change() is being called. You could try to comment this call in tdtpicke.prg. But I don't know if there are any side-effects.

Re: fwh execute another function ?

Posted: Fri Aug 19, 2011 8:02 pm
by sambomb
You can try

Code: Select all

@ 2.9,2 DTPICKER oDate VAR dData OF oBar FONT ofontBig SIZE 180,32 UPDATE //;
//ON CHANGE CHANGE_PLAN(dData,lNumeri)

Activate Dialog... On INIT OnInitDialog()


Procedure OnInitDialog()
   oDate:bChange := {|| ChangePlan(dData,lNumeri) }
Return nil