Cal

Download

Cal is a little program I wrote when I needed it for a demo. Is is quite similar to the Unix command cal. It displays a simple calendar.

Synopsis

cal [-13msyeh?] [[month] year]

Options:

-1 Print one month only (default).
-3 Print the previous month, the month and the next month on one row.
-m Print a calendar where Monday is the first day of the week, as opposed to Sunday.
-s Print a calendar where Sunday is the first day of the week (default).
-y Display a calendar for the entire year.
-e Use English month and day names. Cal will otherwise use the local month and day names.
-h, -? Display a simple help screen.

A single parameter specifies the year (1 - 9999) to be displayed. The year must be fully specified: "cal 89" will not display a calendar for 1989 or 2089. Two parameters denote the month and year. The month is a number between 1 and 12.

A year starts on January 1.

Compilation

Compilation is straighforward.

An older version required my Console unit, but that posed problems when text was redirected to a text file or some other stream (IOW, there is a bug in Console I could not correct yet). Since Console was only used to reverse colours for the display of the current date, I used direct Windows API calls to achieve this, in the new ReverseColors procedure.

Disclaimer

Cal is freeware. All rights are reserved. Its code is provided as is, expressly without a warranty of any kind. You use it at your own risk.

I hope this code is useful to you. If you use some of it, please credit me. If you modify or improve the program, please send me the modifications.

I may improve or enhance Cal myself, and I will try to post changes here. But this is not a promise. Please don't request features.

Rudy Velthuis