Calendar
--------
Calendar is a S*BASIC script to produce an annual calendar on an A4 sheet of
paper, as shown below. You can choose different starting years and months by
fiddling the parameters in the section ** Output harness. Eg:
PrtCal3x4 2023, 1
would print a similar calendar to the one below, except the year would be
2023 and the starting month January.
The point of publishing this script is, that without too much difficulty, it is
possible to create simple calendars of various types to fit different purposes,
by re-using some of the procedures provided:
Global variables
box% = 2: Grid size: Each date entry is this wide (+ 1 space)
fdow = 1: First day of week (0..6, Sunday = 0)
The remaining global variables (except as described below) are dependent on how
you wish to format the output, so theyll be up to you..
proc Init
This procedure initialises the global calendar variables Mnth$, Mnth% and yr%,
where
Mnth$() is an array of month names in full. Alter to suit language
Mnth%() is the accumulated number of days for each month
yr%() will hold the entire calendar ready for formatting
proc Calendar(y%, m%)
produces an annual calendar for the year y%, starting at month m%, in the array
yr%(month%, week%, day%). This calendar can be formatted in various ways, as
shown in the example procedure PrtCal3x4.
proc GetMhd$
fills the global variable mhd$ (month header) with the header to print above
each month block. The first day of the week plus spacing requirements are set
in the global variables fdow and box%, respectively (see global variables,
above). Eg: fdow = 1, box% = 2 => mhd$ = 'Mo Tu We Th Fr Sa Su'
The procedures Pad$, LF and Center$ may be useful in assisting with formatting.
The remaining procedures are used by the calendar calculation part of the
program and dont need to be understood to be used.
Update
======
V0.11 - SuperBASIC-compatible version for Qdos, updated to work with
"negative" date values, so will produce correct calendars beyond
2029 Jan 19 03:14:07.
V0.12 - Still SuperBASIC compatible, but Qdos and Minerva need an
extra toolkit to cater for the unsigned long word date
calculations. SMSQ/E has these commands built in. This makes it
possible to create accurate calendars until 2097 Feb 06 06:28:15!
The date toolkits, by Lawrence Reeves, packaged by me, can be found
under Toolkits at Knoware.no. There are two different versions,
one for Qdos and another for Minerva.
This version has an extra kick: Load the code into QD with the
SBAS/QD Thing installed and a suitably configured and active
FileInfo2. Pressing F10 in QD then creates the calendar and pops
the finished product up into another QD (or other configured
editor) for immediate viewing. If you dont want this feature,
simply remove the FI2_CALL line (around line number 148) then the
calendar will go to the location designated in the configuration
section (around line 130).
Enjoy!
Calendar for 2096
January February March
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 1 2 3 4 5 1 2 3 4
2 3 4 5 6 7 8 6 7 8 9 10 11 12 5 6 7 8 9 10 11
9 10 11 12 13 14 15 13 14 15 16 17 18 19 12 13 14 15 16 17 18
16 17 18 19 20 21 22 20 21 22 23 24 25 26 19 20 21 22 23 24 25
23 24 25 26 27 28 29 27 28 29 26 27 28 29 30 31
30 31
April May June
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 1 2 3 4 5 6 1 2 3
2 3 4 5 6 7 8 7 8 9 10 11 12 13 4 5 6 7 8 9 10
9 10 11 12 13 14 15 14 15 16 17 18 19 20 11 12 13 14 15 16 17
16 17 18 19 20 21 22 21 22 23 24 25 26 27 18 19 20 21 22 23 24
23 24 25 26 27 28 29 28 29 30 31 25 26 27 28 29 30
30
July August September
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 1 2 3 4 5 1 2
2 3 4 5 6 7 8 6 7 8 9 10 11 12 3 4 5 6 7 8 9
9 10 11 12 13 14 15 13 14 15 16 17 18 19 10 11 12 13 14 15 16
16 17 18 19 20 21 22 20 21 22 23 24 25 26 17 18 19 20 21 22 23
23 24 25 26 27 28 29 27 28 29 30 31 24 25 26 27 28 29 30
30 31
October November December
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7 1 2 3 4 1 2
8 9 10 11 12 13 14 5 6 7 8 9 10 11 3 4 5 6 7 8 9
15 16 17 18 19 20 21 12 13 14 15 16 17 18 10 11 12 13 14 15 16
22 23 24 25 26 27 28 19 20 21 22 23 24 25 17 18 19 20 21 22 23
29 30 31 26 27 28 29 30 24 25 26 27 28 29 30
31
Conditions and DISCLAIMER as per Knoware.no
Generated by QuickHTM, 2022 Oct 04