Calendar/Diary, _DiaryDate
A Mac-like desktop accessory kept in Visual FoxPro for "backward compatibility," but hidden within the product, ignored.
Usage |
ACTIVATE WINDOW CALENDAR DEFINE BAR _MST_DIARY OF _MSYSTEM PROMPT "CALENDAR/D\<IARY" |
Figure 1: The Calendar / Diary interface in Visual FoxPro 3.0 and...
Figure 2: The same interface in Visual FoxPro 7: Bolding of characters is gone.
The interface for using the Calendar / Diary is pretty straightforward. The calendar is displayed on the left-hand side, and buttons across the bottom can be used to change the display to a specific month and year. Note also that there is a "Diary" menu that appears when the Calendar is activated, displaying keyboard shortcuts for many of these functions. In versions before VFP 6, a date with a diary entry associated with it is shown in a bolder font (see figure 1); the month and year are displayed in bold when the calendar is active, and in plain text when the diary is active. In VFP 6 and later, all bolding effects are gone (see figure 2). Diary entries are stored in the currently active resource file. If no resource file is available, a dialog box appears when the calendar is activated for the first time, informing the user he/she will be unable to save diary entries. The entry is stored with a TYPE of "Data," an ID of "DIARYDATA," a NAME of the date in DTOS() format ("YYYYMMDD"), the actual entry in the memo field DATA, and a SYS(2007)-generated checksum in the CHKVAL field.Since Microsoft hasn't updated the really ugly interface of this item, we can predict it will probably continue to receive minimal support, perhaps even disappearing in a future release. Using the calendar can be problematic in an application. Storage of diary data in the resource file can cause problems. Because the calendar is a built-in system window, it does not have all of the characteristics or programmability that we may want to integrate into our own application windows, causing difficulties including it within our event handlers. While it may be a handy utility for developers to use, we suggest you consider other sources for supplying a calendar to your users. Several intrepid users have developed all-FoxPro-coded versions of the calendars, available through many of the FoxPro magazines and online services. In addition, there are a several fairly sophisticated ActiveX calendar controls available.
Usage |
dDiaryDate = _DIARYDATE _DIARYDATE = dDateToBeSet |
Example |
STORE {04/11/2000} to _DIARYDATE ? _DIARYDATE |
See Also |
Calculator, Desk Accessories, DToS(), Filer, Puzzle, Set Resource, Sys(2007) |