Classic Computer Magazine Archive START VOL. 3 NO. 4 / NOVEMBER 1988

ON DISK!

PRO CALENDAR

by Anthony Barbieri

Pro Calendar will keep you from missing those appointments--or losing those to-do lists--because it's a memory-resident Desk Accessory that lets you load and save calendars, set alarms and remember holidays.

Let START help you stay on time with CALENDAR.ARC on your START disk! Runs in medium and high resolution.

Pro Calendar is an appointment calendar for your ST. It's also a Desk Accessory, which means you can check your appointments from the Desktop or from within any program that uses the GEM menu bar. You can scroll through calendars by months or years or jump directly to any month from January 1786 to December 32767. (We suggest you call and confirm any doctor's appointment you make for these later years.)

With Pro Calendar, you can enter your appointment schedule and write yourself short reminders or longer to-do lists, then save everything to disk. You can also set 279 (or fewer) alarms--and they'll even ring inside GEM programs! Pro Calendar has 22 major holidays memorized; it already knows, for example, that the fourth Thursday of every November is Thanksgiving. For those times you're away from your ST, you can also print out small, convenient appointment schedules. You can even save a month's calendar in DEGAS picture file format. Pro Calendar runs in medium or high resolution.


Time To Go!

To set up your appointment calendar, copy CALENDAR.ARC and ARCX.TTP onto a blank, formatted disk and unARC CALENDAR.ARC, following the Disk Instructions elsewhere in this issue. Next, copy CALENDAR.ACC into the root directory of your boot disk and reboot your ST. Pro Calendar will read the ST's internal clock and set itself correctly; unless you have a Mega, hard drive with an internal clock or have an add-on ST cartridge or chip clock, you must set your ST's clock to the correct date and time using CONTROL.ACC or any of the public domain time-setting accessories available.

To access Pro Calendar, simply click on Pro Calendar on the Desk menu of the Desktop or any GEM-based program. Pro Calendar will then display a calendar of the current month, such as that shown in Figure 1. On machines with no clock (or if you haven't set your ST's clock), you will most likely see January 2028.

calender1.jpg Figure 1. Pro Calen-
dar is a full-screen
appointment and
reminder calendar.
You can generate a
calendar for any
month between
January 1786 and
December 32767.

You can move forward or backward through the calendar by month or by year by clicking on PRIOR YEAR, NEXT YEAR, PRIOR MONTH or NEXT MONTH. Alternately, you can choose a month and year to display directly by clicking on SET DATE.

To load a calendar from disk, simply click on LOAD CALENDAR. Pro Calendar's default filename extender is .CAL, but Pro Calendar will check for invalid file formats so that you may use other extensions. Don't worry about setting the date before loading your calendar; Pro Calendar will automatically display the correct month and year. If you want to make maximum use of Pro Calendar, always load the current month's calendar before moving on to another application. Pro Calendar will then be able to ring any alarms set for that day.

In order to minimize memory usage, Pro Calendar holds only one calendar in memory at a time. Whenever you change calendars, an alert box will warn you that the current calendar will be cleared (and any entries you've made erased) if you continue. Just save your current calendar before moving on by clicking on SAVE CALENDAR. You may even have multiple calendars for the same month, say, one for business appointments and another for personal notes; just save each under a different filename. Pro Calendar will overwrite any calendar file on disk if you save your new calendar with the same filename, so if you want to have two different calendar files, just assign them different filenames.


Appointments And Reminders

Just like any desk calendar or daybook, Pro Calendar lets you write down your appointment calendar, notes and reminders. To enter appointments or notes, first highlight a date by clicking on its number. Then click on EDIT DAY and a notepad such as shown in Figure 2, will appear. If you have already written yourself a note or reminder for that date, it will appear; otherwise the notepad will be blank. The APPOINTMENTS AND THINGS TO DO area gives you nine text lines for grocery lists, appointments or notes. You can move the text cursor with the mouse or with the cursor control keys and the Tab key will take you to the next line.

If you want to start over, click on CLEAR ALL to empty all the entries in the APPOINTMENTS AND THINGS TO DO area. If you decide not to keep any changes you've made, simply click on Cancel and you will be returned to the main Calendar screen with your original list intact.

The small notepad in the upper right corner labelled REMINDERS is for important notes that you want to appear on the calendar itself. Simply position the cursor in this area with the mouse, cursor keys or Tab key and type in your reminder.

Note that the cursor does not "wrap around" to the next line in either the APPOINTMENTS AND THINGS TO DO or REMINDERS areas. If you have an entry that requires more than a single line of text, you will have to Tab down to the next line when you come to the end of the first line. The Return key has no effect in text entry. To erase individual lines in the appointment or reminder box, position the text cursor on the line and press the Escape key. Once you are satisfied with your entries, click on OK and Pro Calendar will remember your list and reminders and return you to the main screen.


It's Alarming!

You can also set alarms that will ring from the Desktop or while running a GEM program. To set an alarm, type a number sign (#) at the beginning of a line in the APPOINTMENTS AND THINGS TO DO area, then the time in 24-hour format, a space and then the note itself. For example, a note to go shopping at 1:25 PM would be:

#13:25 Time to go shopping!

You can set up to nine alarms for each day of the month. After you set an alarm and return to your host program or the Desktop, Pro Calendar will monitor the system clock to see if it's time for an alarm. You must have the current month's calendar loaded into Pro Calendar and the system clock/calendar must be correct. When an alarm goes off, the monitor bell will ring and, if possible, an alert box will appear on the screen saying "lT'S TIME TO. . " followed by the text of the alarm message.


calender2.jpg Figure 2. The
notepad lets you
post a quick
reminder for a cer-
tain day or type in
up to nine lines of
appointments and
notes.

Take Me Along

You won't always be sitting at your ST when you need to know your appointments. Pro Calendar will print out a wallet-size reproduction of your APPOINTMENTS AND THINGS TO DO list for you. Just make sure your printer is on-line and then click on PRINT from the Edit Day screen. The printout consists of the title APPOINTMENTS AND THINGS TO DO, the date and your appointment list surrounded by a box of asterisks.

When you are done making entries, click on OK to return to the main calendar.

I Remember When. . .

You can save your calendar as data for Pro Calendar or save the entire screen as an uncompressed DEGAS image file in the current screen resolution. If you want to save your calendar as an image, be sure you have enough (at least 32K) free space on your disk. Once saved as a DEGAS file, you can load it into most popular drawing programs, edit it, embellish it, stretch it, shrink it and then print it out.

HOLIDAY

New Year's Day
Martin Luther King Jr. Day
Lincoln's Birthday
St. Valentine's Day
Washington's Birthday
Ash Wednesday
Patrick's Day
Good Friday
Passover
Easter Sunday
Mother's Day
Memorial Day
Father's Day
Independence Day
Labor Day
Columbus Day
Halloween
Election Day
Veteran's Day
Thanksgiving
Hanukkah
Christmas Day

OCCURRENCE

January 1
3rd Mon. in January
February 12
February 14
3rd Mon. in February
varies (1988-1993)
March 17
varies (1988-1993)
varies (1988-1993)
varies (1987-2010)
2nd Sunday in May
Last Monday in May
3rd Sunday in June
July 4
1st Mon. in Sept.
2nd Mon. in October
October 31
1st Tue. after Mon. in Nov.
November 11
4th Thurs. in Nov.
varies (1988-1993)
December 25

ABBREVIATION

NEW YR.
MLK DAY
LINCOLN
ST. VAL
WASHTON
ASH WED
ST. PAT
GOOD FR
PASSOVR
EASTER
MOM DAY
MEMOR D
DAD DAY
INDEPEN
LABOR D
COLMBUS
HALOWEN
ELECTN
VET DAY
THANKS
HANUKAH
XMAS
Figure 3. Pro Colendor remembers 22 secular and religious holidays. You can plan
around them--or plan for them.

If you choose this to save your calendar as Data, a default disk and filename is provided for you; you need only press the Return key to use them. Otherwise, type the entire path and filename for the calendar. It's good practice to save your calendars before you exit Pro Calendar to the Desktop or enter another program, just in case your other program bombs and locks up the computer.


Holidays

Pro Calendar is programmed to remember the religious and secular holidays listed in Figure 3. You should never forget Mother's Day again (your mother will appreciate this). Certain religious holidays, such as Easter and Passover, are not based on our Julian calendar and are only included over the time frame noted.


Customizing Pro Calender's Source Code

Pro Calendar makes an excellent desk accessory, but there may be times when it's more convenient for you to use it as a stand-alone application. If you have a C compiler with all the standard libraries for GEM, this is easy. First, completely delete these procedures and functions: int alarm(day,hour;min,textp), display_alarm(al_line) and get_rtime(year,month,day,hour,min).

Next, replace the main( ) procedure with this:

main( )
{

    appl_init( );
    graf_handle(&gl_wchar,&gl_hchar,
    &gl_wbox,&gl_hbox);
    get_date(&curmonth,&curyear);
    resolution=Getrez( );
    if (!resolution) /* if in low resolution */
      form_alert(1,
      "[3][ | Only works in MEDIUM RES | or HIGH RES] [Abort]");
    else{
      build_tree( );
      startup( );
      }
    appl_exit( );
}

Finally, compile and link it as a standard program. You must reserve a stack size no smaller than 4K.


Adding Your Own Holidays

For example, to add your birthday as November 30th, first find the procedure called ins_holidays(month,year,off). Next, find the case statement which corresponds to the number of the month your holiday is in (i.e. 11 for November). After the preset holidays and before the break enter a line in the form:

hol_ted[off+ {the date of holiday-1 }
].te_ptext=" { 7 chars. Max } ";

our example is:

hol_ted[off+29].te_ptext="MY BDAY";

You may add as many new holidays as you wish, but if two fall on the same day, only the last one assigned will be shown on the screen.

Here's hoping that you'll never miss an appointment again!

Anthony Barbieri is currently a junior Computer Science major at San Jose State University.