Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Urs Eggmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: calendar controll Date: Sun, 1 Mar 2020 20:41:18 +0100 Lines: 54 Message-ID: References: <49aaabb2-544a-4709-8705-94784696e717@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Trace: individual.net iNaZ6ger0CqLmIiy5MRqCgfPtW8zfi/GxlmBzbiZyW7d0tB43j Cancel-Lock: sha1:bUXMaYcLU3AaHAuCflaQk4IppBg= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-EsetId: 37303A29266DE36F63746A X-EsetScannerBuild: 44619 Xref: csiph.com comp.lang.clipper.visual-objects:12880 Hi Aurora, I have killed the Bug! In module ccCalendar, line 3 the dTarget is formed with the function ConDate(, , ) ---> dDate The third parameter is the number of the day in the protect variable dActualDate and that is the February 29th! So, the return value is a NULL_DATE and that causes the error. The program tries to go to the februarry 29 of a non leap year... Obviously nobody has tested ever the program exactly at a switching day of a leap year. As a workaround I set the third param to 1, a day you have in every month. BUT, if you have other dependencies of the dActualDate in your program it is essential to check the effects very carfully. Modified Method: ******************************************** METHOD MoveYear(n) CLASS ccCalendar // Adapted from VO-Original example LOCAL dTarget AS DATE * dTarget := ConDate(Year(SELF:dActualDate) + n ,Month(SELF:dActualDate),Day(SELF:dActualDate)) dTarget := ConDate(Year(SELF:dActualDate) + n ,Month(SELF:dActualDate), 1 ) IF IsMethod(SELF , #Actualize) SELF:Actualize(dTarget) // Nachführen des Calendar-Controls ENDIF IF IsMethod(SELF:Owner , #Feiertage) SELF:Owner:Feiertage() // Aktualisieren in der Anzeige des Owners ENDIF RETURN NIL *********************************** HTH and regards Urs PS: For testing I had to switch my PC temporarily to the february 29 (bg) schrieb im Newsbeitrag news:eeb805e9-57f9-4963-9d7f-9e6998ffe399@googlegroups.com... > Il giorno domenica 16 febbraio 2020 11:09:46 UTC+1, aurora...@gmail.com ha > scritto: >> sorry my english >> is there any way to have bigger fonts in calendarcontroll? >> Thanks >> aurora baccio > > > good afternoon, > I point out that moving a year forward (from 2020 to 2021) the error > NUMERIC OWERFLOW appears line 12 DRAWDAYS > thank you > aurora baccio