Page 1 of 1

Error DC_POPDATE when using keyboard

Posted: Thu Aug 10, 2023 8:06 am
by skiman
Hi,

With the current version there is an error when using the keyboard in the PopupDate.

In _dccalen.prg the following lines ( 565-574 ) should be changed, extra parameters must be added, otherwise an error appears since the vars aren't defined by a default in _dccalen2:

Code: Select all

...         
         ELSEIF mp1 = xbeK_ESC
            _DCCalen2(aPopDate,DCCALEN_ABORT,bIsHoliday,aColors,bAction,nScale)
            lOk := .f.
         ELSEIF mp1 = xbeK_ENTER
            _DCCalen2(aPopDate,DCCALEN_EXIT,bIsHoliday,aColors,bAction,nScale)
         ELSEIF _DCHotKey( DC_LangMsg(DCMSG_OK), mp1)
            _DCCalen2(aPopDate,DCCALEN_EXIT,bIsHoliday,aColors,bAction,nScale)
         ELSEIF _DCHotKey( DC_LangMsg(DCMSG_CANCEL), mp1)
            _DCCalen2(aPopDate,DCCALEN_ABORT,bIsHoliday,aColors,bAction,nScale)
         ENDIF
         ...
Changing the _dccalen2 function would also be an option.

Re: Error DC_POPDATE when using keyboard

Posted: Fri Sep 15, 2023 12:48 am
by skiman
Ho Roger,

Have you seen this? Do you also have an error when using the keyboard?

Re: Error DC_POPDATE when using keyboard

Posted: Fri Sep 15, 2023 7:51 am
by rdonnay
I could only make it error when pressing the ESC key.

Tell me how you are using it and what keys are giving errors.

Re: Error DC_POPDATE when using keyboard

Posted: Sat Sep 16, 2023 2:01 am
by skiman
Hi Roger,

when the popup appears go to the day you want with the arrow keys and hit enter to select.

------------------------------------------------------------------------------
oError:args :
-> VALTYPE: N VALUE: 8
-> VALTYPE: U VALUE: NIL
oError:canDefault : N
oError:canRetry : N
oError:canSubstitute: Y
oError:cargo : NIL
oError:description : Parameter has a wrong data type
oError:filename :
oError:genCode : 2
oError:operation : <8> * <NIL>
oError:osCode : 0
oError:severity : 2
oError:subCode : 3
oError:subSystem : BASE
oError:thread : 3
oError:tries : 0
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from _DCCALEN2(753)
Called from DC_GUIPOPDATE(569)
Called from DC_POPDATE(95)
Called from (B)FFACTUREN(2974)
Called from _READCLICK(2495)
Called from (B)_POPCLICK(2476)
Called from _POPUPBUTTONACTIVATE(2529)
Called from (B)DC_XBPGET:CREATE(678)
Called from XBPPUSHBUTTON:HANDLEEVENT(1515)

Re: Error DC_POPDATE when using keyboard

Posted: Mon Sep 18, 2023 6:45 am
by rdonnay
Here is a fix:

_DCCALEN.PRG, starting at line 565:

Code: Select all

         ELSEIF mp1 = xbeK_ESC
            _DCCalen2(aPopDate,DCCALEN_ABORT,,,,nScale)
            lOk := .f.
         ELSEIF mp1 = xbeK_ENTER
            _DCCalen2(aPopDate,DCCALEN_EXIT,,,,nScale)
         ELSEIF _DCHotKey( DC_LangMsg(DCMSG_OK), mp1)
            _DCCalen2(aPopDate,DCCALEN_EXIT,,,,nScale)
         ELSEIF _DCHotKey( DC_LangMsg(DCMSG_CANCEL), mp1)
            _DCCalen2(aPopDate,DCCALEN_ABORT,,,,nScale)
         ENDIF
Rebuild DCLIPX.DLL by running BUILD20.BAT.

Re: Error DC_POPDATE when using keyboard

Posted: Mon Sep 18, 2023 7:50 am
by skiman
Hi Roger,

This is about the same modification as I did. See the first post. I added all the parameters.

Re: Error DC_POPDATE when using keyboard

Posted: Mon Sep 18, 2023 4:18 pm
by rdonnay
This is about the same modification as I did. See the first post. I added all the parameters.
Sorry, I didn't go back far enough in the thread to see that you already had a solution.