Partager via


_DIARYDATE System Variable

Contains the current date in the Calendar/Diary.

_DIARYDATE = dExpression

Parameters

  • dExpression
    Specifies the date for the Calendar/Diary.

Remarks

With _DIARYDATE, you can display the Calendar/Diary with a specific date selected, or you can return the selected Calendar/Diary date.

By default, the current date is stored in _DIARYDATE. When you open the Calendar/Diary, the current date is selected. You can store a different date to _DIARYDATE so that the Calendar/Diary opens with this new date selected.

Selecting a new date when the Calendar/Diary is open causes the new date to be stored to _DIARYDATE. When you close the Calendar/Diary, _DIARYDATE contains the last selected date.

Example

In the following program example, the Calendar/Diary opens with March 28, 2001, selected and the value of _DIARYDATE appears below. July 4, 1776, is then stored to _DIARYDATE and _DIARYDATE displays again. The program then uses the DATE( ) function to select the current date, and displays _DIARYDATE.

SET CENTURY ON
STORE {^2001-03-28} TO _DIARYDATE
=MESSAGEBOX(DTOC(_DIARYDATE),64)
ACTIVATE WINDOW calendar
=MESSAGEBOX("Change date to July 4, 1776",48))
STORE {^1776-07-04} TO _DIARYDATE
=MESSAGEBOX(DTOC(_DIARYDATE),64)
=MESSAGEBOX("Change date to today's date",48)
STORE DATE( ) TO _DIARYDATE
=MESSAGEBOX(DTOC(_DIARYDATE),64)
RELEASE WINDOW calendar

See Also

Tasks

Add a Data-Bound Calendar Sample

Reference

STORE Command

SET CENTURY Command

ACTIVATE WINDOW Command

System Variables Overview

Other Resources

Language Reference (Visual FoxPro)