Calendar and Diary

[Calendar] Visual FoxPro includes a simple calendar and diary accessory which stores the user's appointments. It appears as a separate window and is neither as impressive nor as flexible as the ActiveX calendars such as mscal.ocx. It is however very much simpler to use and can be distributed freely with your FoxPro executable.

Another advantage is that it is self-contained and does not rely on your users having the correct version of the various external DLLs that are required by the more complex ActiveX solutions. This means that you can guarantee that the calendar will keep on working, regardless of what other software your users might be installing or removing.

Using the Calendar

The calendar no longer appears as an option on any of the FoxPro menus. The only way to make it appear is through program code. You can write code to call the calendar from a command button or from a menu option or perhaps from a hot key:

Activate Window 'calendar'

The date selected by the user is stored in the FoxPro system variable _DIARYDATE. You can read and write to this variable whether or not the Calendar window is visible. If you set the value of _DIARYDATE:

_DIARYDATE = {25/12/2006}

then the Calendar will (at least in the UK) display the month of December 2006 with the 25th selected and the events of the 25th visible.

[Warning of missing resource file] The events for each day are stored in the Data field of the FoxUser table. The Calendar application will still work without the resource file but an unpleasant warning message is displayed before the calendar appears.

Because the Calendar is a window within FoxPro you can use the standard functions to inspect its status. For example:

?WVISIBLE ('calendar')

will return .T. if the Calendar window is visible.

Like the Calculator, the Calendar tool has been available since version 2.00 of FoxPro for DOS.