Pointer to a TDateTime value System unit
  type PDateTime = ^TDateTime;
The PDateTime type is a pointer to a TDateTime value.
Pointer arithmetic, such as Inc, Dec can be used on it, for example to navigate a block of TDateTime values, as in the example.
Related commands
Dec Decrement an ordinal variable
Inc Increment an ordinal variable
TDateTime Data type holding a date and time value
 Author links

 Buy Website Traffic at

 Buy Proxies at
 Download this web site as a Windows program.

Example code : Store 3 TDateTime values in memory and navigate through them
  dateTimePtr : PDateTime;
  a : TDateTime;

  // Allocate storage for three date time variables
  GetMem(dateTimePtr, 3 * SizeOf(Extended));

  // Fill out these date time variables
  dateTimePtr^ := Yesterday;
  dateTimePtr^ := Date;
  dateTimePtr^ := Tomorrow;

  // Now display these values
  Dec(dateTimePtr, 2);
  ShowMessage('Yesterday = '+DateToStr(dateTimePtr^));
  ShowMessage('Today     = '+DateToStr(dateTimePtr^));
  ShowMessage('Tomorrow  = '+DateToStr(dateTimePtr^));
Show full unit code
   Typical program output:
   Yesterday = 10/04/2003
   Today     = 11/04/2003
   Tomorrow  = 12/04/2003
Delphi Programming Neil Moffatt 2002 - 2018. All rights reserved.  |  Home Page