Talk:French Republican calendar: Difference between revisions
Content added Content deleted
m (→bugfix in Go) |
(About the BBC BASIC entry) |
||
Line 28: | Line 28: | ||
--[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 21:18, 24 January 2019 (UTC) |
--[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 21:18, 24 January 2019 (UTC) |
||
I'm not the author of the BBC BASIC entry. (I'm using FREEBasic nowadays), but it is old school basic and the bug fix was very easy. |
|||
The BBC BASIC (for Windows) is not broken. |
|||
Tested it with following programs. |
|||
BBC BASIC for Windows 5.94a(trial) - 8Kb |
|||
BBC BASIC for Windows 6.12a(trial) - 32Kb |
|||
BBC BASIC for SDL 2.0 Win32 Version 0.29a |
|||
The trial versions have limit on the amount of memory that can be used for the user’s program + data + stack. |
|||
The size of the program is about 4180 bytes. A trial version that has only 4Kb of memory available can’t run this program. |
|||
Bugfix: |
|||
In the <b>DEF PROC_day_to_rep</b>, <b>sansculottides%</b> is set to 6 if <b>y%</b> = is a leap year. If <b>y%</b> is increased in the While loop <b>sansculottides%</b> is not set to 5 as it should. |
|||
Solution: copy <b>IF FN_rep_leap(y%) THEN sansculottides% = 6 ELSE sansculottides% = 5</b> before <b>While</b> and paste it under the line with <b>y% += 1</b> in the While loop. |
|||
<lang qbasic>DEF PROC_day_to_rep(day%, RETURN d%, RETURN m%, RETURN y%) |
|||
LOCAL sansculottides% |
|||
y% = INT(day% / 365.25) |
|||
IF FN_rep_leap(y%) THEN y% -= 1 |
|||
d% = day% - INT(365.25 * y%) + INT((y% + 1) / 100) - INT((y% + 1) / 400) |
|||
y% += 1 |
|||
m% = 1 |
|||
rem copy the next line |
|||
IF FN_rep_leap(y%) THEN sansculottides% = 6 ELSE sansculottides% = 5 |
|||
WHILE d% > 30 |
|||
d% -= 30 |
|||
m% += 1 |
|||
IF m% = 13 THEN |
|||
IF d% > sansculottides% THEN |
|||
d% -= sansculottides% |
|||
m% = 1 |
|||
y% += 1 |
|||
rem paste the line here |
|||
ENDIF |
|||
ENDIF |
|||
ENDWHILE |
|||
ENDPROC</lang> |
|||
--[[User:Frisian|Frisian]] ([[User talk:Frisian|talk]]) 21:20, 6 February 2019 (UTC) |