I ran into a problem in Change Method .
- Code: Select all Expand view
METHOD Change() CLASS TCalendar
local aTmp
static dOldDate, dOldDate2
if ::bChange != nil
if ::lMultiselect
aTmp = ::GetDateRange()
if dOldDate != aTmp[ 1 ] .or. dOldDate2 != aTmp[ 2 ]
Eval( ::bChange, Self )
dOldDate = aTmp[ 1 ]
dOldDate2 = aTmp[ 2 ]
endif
else
if dOldDate != ::GetDate()
Eval( ::bChange, Self )
dOldDate = ::GetDate()
endif
endif
endif
return nil
I have a dialog with a CALENDAR
The problem is
- Code: Select all Expand view
static dOldDate
The first time I open the dialog bChange it works because dOldDate is nil
If I reopen the dialog bChange it doesn't work because dOldDate remains the same as before
I solved it by creating a variable and deleting dOldDate , I dont use ::lMultiselect
- Code: Select all Expand view
DATA _dOldDate
METHOD Change() CLASS TCalendar
local aTmp
static dOldDate2
if ::bChange != nil
if ::lMultiselect
aTmp = ::GetDateRange()
if dOldDate != aTmp[ 1 ] .or. dOldDate2 != aTmp[ 2 ]
Eval( ::bChange, Self )
dOldDate = aTmp[ 1 ]
dOldDate2 = aTmp[ 2 ]
endif
else
//if dOldDate != ::GetDate()
if ::_dOldDate != ::GetDate()
Eval( ::bChange, Self )
//dOldDate = ::GetDate()
::_dOldDate = ::GetDate()
endif
endif
endif
return nil