8-Bit Software Online Conversion

9 August 1995 A Desk Diary by D. Ambrose Barry Thorpe presented an excellent program in the December 1988 Beebug, which he called Calendar (available now from 8-BS on BUG-19) that was more correctly described in the accompanying article as " A Monthly Desk Diary". It does what it says - prints out a diary (with an Epson compatible printer) with a month on an A4 page, including statutory holidays and any reminders the user wishes to incorporate (birthdays, etc) read from a text file, DATES, built up according to a pattern exemplified by the model offered here. Note that there must be entries for January, and at a fictitious date after 31 December, which here are dummies. (In case you do not see it, each one is a space before carriage return, ASCII 13). Each entry in DATES (which I compile using EDIT) must be on a separate line and of the form 24/6/Midsummer Day, i.e. day, month, entry separated by /. The last character in DATES must be | (line 2310). However, I like to organise my life by weeks not months so I had to modify the program to take account of the fact that weeks do not always start on the first of the month, and the modified program offered here prints a diary with two weeks on an A4 page. I am not certain that I have tackled the problem in the best way but I am certain that I could never have written such a program from scratch, and for the two Procedures I have added to achieve my object I had the original PROConepersheet as a model. PROCdiscard discards the unwanted days of the month preceding the start month of the diary to complete the first week, and PROCgather brings in days of the month following the last month of the diary so as to complete the last week. Since solving the problem of the beginning and end of the first and last weeks I have not bought a diary to hang on my kitchen wall but have printed my own. Just for fun (because I do not really pay much attention to what the moon is doing) I have now also included the MOON program I wrote that appeared in 8-BS 46(1), so my most recent diary includes the phases of the moon as well as family birthdays. The original program numbering is unaltered with all the lines ending in zero; my modifications (before line 3240) end with a digit other than zero. When the program is RUN the original Mode 7 screen will appear asking whether you wish to print the diary or check the file, DATES. If you choose the latter PROCcheckfile checks that the dates in DATES are in correct order; otherwise you will be asked the year, the month, and number of months required. (To begin with I had bugs when overrunning the end of the year and I believe I have eliminated these but, in fact, I have only printed a twelve-month diary beginning with January). After clearing the screen you are asked "PRINTER ON?", to be answered by Y or any other key. To convince you all is well "Calculating phases of the moon" (output from PROCmoon is stored on disc in PMOON), "Calculating holidays", "Discarding preceding month" will appear and the unwanted days of the preceding month will be run on screen (in page mode if printer is not on) until the first week to be printed is reached; then "Now we start: insert paper" will appear. Do just that and press a key. Two weeks will be printed and printing will stop for insertion of a new sheet and another key press, and so on until the end is reached. I have circumvented several features of the original program that do not suit me. 1. Line 1420 demands that the printer be on whereas I only use the program once a year and want to know that it is working as intended before printing. Hence line 1414 and 1415 and these allow me to see on screen first. 2. When the program ends I want it to end so I have eliminated the REPEAT in line 110. It is very simple to type RUN and press RETURN (I have key 7 programmed RUN|M). 3. I know DATES is available, I do not want to be asked about it every time the program is run. Hence the jump over line 2060. The modifications can easily be removed if you prefer the original. It will be noted (line 175) that I always use mode 131 and paged mode. There is an inefficiency in that PROCmoon recalculates the phases of the moon every time the program is RUN and once a session would be enough; however, for a program used only once a year it did not seem worth the trouble of dealing with this.