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.

Related Items

Alvechurch Data - Microsoft FoxPro and Access Database Development and Training

Alvechurch Data are based close to Birmingham and provide Microsoft Access and Visual FoxPro training, development and support.

Read More

Autocomplete in Visual Fox Pro

Autocomplete in Visual Fox Pro

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.

Read More

FoxPro Functions

FoxPro has always had functions like FREAD and FWRITE to read and write files at a low level. They can handle files which defeat the STRTOFILE and FILETOSTR functions.

Read More

Development Services

Alvechurch Data specialise in Microsoft Access and Visual FoxPro databases and have fifteen years experience developing databases for small business use.

Read More

Access and Visual FoxPro Training

Microsoft Access and Visual FoxPro training courses and workshops offered by Alvechurch Data in Birmingham.

Read More