Custom Calendar

By Richard Dimond

Originally published in EUG #17

I thought my calendar program would be a good contribution for the Christmas issue of EUG. You may well say that you have a calendar program or that there are already several to choose from but I don't think yhat you will have seen one quite like this before! I have called it 'Customised Calendar' as you have several options to print it out as you wish.

The utility makes full use of an Epson type printer's graphics to form a neat printout and also Bank Holidays and/or Weekends can be emphasised. The dates can also be printed from Sunday as they used to be or from Monday as they are now. Those of you without a printer will be able to see the dates emphasised as these will be shown in inverse colours.

On running the program you are first asked for the year and this should be the full four figure number. For example, 1995. This is followed by the start day <S>unday or <M>onday.

The next option is whether you want the Bank Holidays emphasised. If you do, these will need to be entered by the day and month numbers as requested. When all eight are entered, you have the choice of emphasising the weekends and the screen display or printout.

The program itself is rather complex and probably not my tidiest of my programs as I have rather hastily added all the procedures on the end of it. It originally only printed from Sunday to Saturday and I have only just realised how to alter it to Monday to Sunday. Perhaps a few notes on each procedure will help those interested in looking to see how it works.

PROCinput-allows the input of the year
calls PROCweekstart and sets b=37 for Sun/Sat listing or b=36 for Mon/Sun listing
Line 290-lp%=1 if a leap year
lp%=0 if not
Line 310-finds day of Jan 1, =D%
init-initiates the arrays and loads the arrays m$ and M% with the name of the month and number of days
calc-enters the array d% with the day numbers for each month, starting at the day position of the first day. For example, if Jan 1 is a:
Friday
for a Mon/Sun listing d%(1,5)=1
for a Sun/Sat listing d%(1,6)=1
list-prints to screen in paged mode
print-gives a printer output
m(m%)-selects name of the month and column to print it. Also the underlining on a printout
lm-prints a month line
d-prints the day headings
l-prints the dividing lines
line(a%,b%,n%)-prints the dates
a% and b% select the limits for the c% FOR/NEXT loop to print the 7 dates or blanks if d%(o%,c%)=0
n% selects the month number
heading-this selects double width and double-height printing for the printouts. The graphics characters can be varied to give a different heading - you could even add further procedures to give a choice. (Anyone fancy submitting some ideas?)
listing-prints out the calendar
p-sets B% TRUE for dates to be emphasised
e-sets the printer for emphasis
pt-inverts colours and prints
bank-allows entry of the 8 bank holidays
weekstart-sets sun% TRUE for Sun/Sat listing or FALSE for Mon/Sun listing
empwe-selects the Sats and Suns and sets B% to TRUE for these
wkends-sets we% to TRUE for emphasis and FALSE if not

Richard Dimond, EUG #17