Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Death, when unnecessary, is a tragic thing. -- Flint, "Requiem for Methuselah", stardate 5843.7


devel / comp.sys.acorn.apps / Director's Calendar - weird bug

SubjectAuthor
* Director's Calendar - weird bugHarriet Bazley
`* Re: Director's Calendar - weird bugHarriet Bazley
 `- Re: Director's Calendar - weird bugMartin

1
Director's Calendar - weird bug

<c8cf64115a.harriet@bazleyfamily.co.uk>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=1515&group=comp.sys.acorn.apps#1515

 copy link   Newsgroups: comp.sys.acorn.apps
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: harr...@bazleyfamily.co.uk (Harriet Bazley)
Newsgroups: comp.sys.acorn.apps
Subject: Director's Calendar - weird bug
Date: Tue, 02 Aug 2022 01:26:01 +0100
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <c8cf64115a.harriet@bazleyfamily.co.uk>
Injection-Info: reader01.eternal-september.org; posting-host="48cf93a7048e9336119105675d37b604";
logging-data="1210520"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Nyd/Zy+BmUFeoGwDisQLNRMI1YR43Ovs="
User-Agent: Messenger-Pro/8.04 (MsgServe/8.04) (RISC-OS/5.29) NewsHound/v1.53-32 RC1
Cancel-Lock: sha1:qDn6Q4VxYxJnR83croEMbCWtLgE=
X-Clacks-Overhead: GNU Terry Pratchett
 by: Harriet Bazley - Tue, 2 Aug 2022 00:26 UTC

Yesterday (i.e. before midnight on Monday) the !Calendar app inside
Director was telling me that it was Sun 1st August. Now it has rolled
over to correct itself to Tuesday 2nd August... while I was in the
middle of trying to debug it, so we shall never know what was going on!

--
Harriet Bazley == Loyaulte me lie ==

Profanity is the one language all programmers know best.

Re: Director's Calendar - weird bug

<483b6a115a.harriet@bazleyfamily.co.uk>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=1516&group=comp.sys.acorn.apps#1516

 copy link   Newsgroups: comp.sys.acorn.apps comp.sys.acorn.programmer
Followup: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: harr...@bazleyfamily.co.uk (Harriet Bazley)
Newsgroups: comp.sys.acorn.apps,comp.sys.acorn.programmer
Subject: Re: Director's Calendar - weird bug
Followup-To: comp.sys.acorn.programmer
Date: Tue, 02 Aug 2022 02:25:13 +0100
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <483b6a115a.harriet@bazleyfamily.co.uk>
References: <c8cf64115a.harriet@bazleyfamily.co.uk>
Injection-Info: reader01.eternal-september.org; posting-host="48cf93a7048e9336119105675d37b604";
logging-data="1213514"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tgNEupLijOrUmL5xx7FtvALia00+CZLM="
User-Agent: Messenger-Pro/8.04 (MsgServe/8.04) (RISC-OS/5.29) NewsHound/v1.53-32 RC1
Cancel-Lock: sha1:10DGEnvzXxelqUvuoe0N9DWcJT8=
X-Clacks-Overhead: GNU Terry Pratchett
 by: Harriet Bazley - Tue, 2 Aug 2022 01:25 UTC

On 2 Aug 2022 as I do recall,
Harriet Bazley wrote:

> Yesterday (i.e. before midnight on Monday) the !Calendar app inside
> Director

!Director.Apps.!Calendar

> was telling me that it was Sun 1st August. Now it has rolled over to
> correct itself to Tuesday 2nd August... while I was in the middle of
> trying to debug it, so we shall never know what was going on!
>

There is definitely a bug in this app affecting *every* first day of the
month, which will always get displayed in the wrong column, as can be
demonstrated by forcibly setting the value of TIME$ just before it gets
checked. Put it back to 1st August, or 1st June, or 1st July, and they
all go wrong in the same manner.

It is too late at night and I can't get my head around why exactly the
program is doing what it is doing: the calculation is
(VAL(MID$(TIME$,5,2))+16+calday%) when calculating the icon handle to
highlight in red for 'today', where the icon numbers start at 18 for the
first Sunday in a month, and where calday% starts off as the index into
an array of day names where Sunday is 1, and is then cycled downwards
according to the date value to form an arbitrary offset pointer:

FOR n=VAL(MID$(TIME$,5,2)) TO 2 STEP -1
PROCcalday_change(-1)
NEXT n

DEF PROCcalday_change(nd)
calday%=calday%+nd
IF calday%<1 calday%=7
IF calday%>7 calday%=1
ENDPROC

I would *assume* that the problem is that PROCcalday_change gets called
the same number of times whether VAL(MID$(TIME$,5,2)) is 01 or 02, since
the FOR loop isn't being allowed to go below 2, but I don't see why that
causes the value of calday% to (apparently) be one integer smaller than
it ought to be if TIME$ contains 01.

The routine that is printing the numbers from 1 to (no_of_days_in_month)
puts day 1 in the wrong column when the value of calday% is wrong, too:

FOR n=1 TO monthd(calmonth%)
PROCset_icon_string(calendar%,(16+calday%+n),STR$(n))
NEXT n

But if I experimentally alter the FOR loop to go to 1 STEP -1 that makes
everything go haywire, so there is clearly a good reason for this odd
constraint!

--
Harriet Bazley == Loyaulte me lie ==

The attacker must vanquish; the defender need only survive.

Re: Director's Calendar - weird bug

<5a119f177bNews03@avisoft.f9.co.uk>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=1517&group=comp.sys.acorn.apps#1517

 copy link   Newsgroups: comp.sys.acorn.apps
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 02 Aug 2022 06:00:45 -0500
From: New...@avisoft.f9.co.uk (Martin)
Subject: Re: Director's Calendar - weird bug
Newsgroups: comp.sys.acorn.apps
Date: Tue, 02 Aug 2022 12:02:35 +0100
Message-ID: <5a119f177bNews03@avisoft.f9.co.uk>
References: <c8cf64115a.harriet@bazleyfamily.co.uk> <483b6a115a.harriet@bazleyfamily.co.uk>
User-Agent: Pluto/3.19a (RISC OS/5.29) NewsHound/v1.54
Organization: None
Lines: 11
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-kTvRD1dQKks9bT/Q6VCa5MI4GCwMOp6RKDFxDSMIgnL4578fn0l7n7xpAIFanC6OIfnJCA4u8OEVMu4!KdXdag0aQn3l/7I1V2j8JC/8aQCbXudvx6Kcv06kUNgdD+S6uBzLsbMYKEC2MQL73jDLKOMWhVbW!qho=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1256
 by: Martin - Tue, 2 Aug 2022 11:02 UTC

In article <483b6a115a.harriet@bazleyfamily.co.uk>,
Harriet Bazley <harriet@bazleyfamily.co.uk> wrote:

[Snip]

Cross-posted to csa.programmer ... where I have replied.

--
Martin Avison
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received.

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor