unit EncodeDate;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Mask, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Label1: TLabel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: EncodeDate
// Routine: SysUtils.EncodeDate
// Routine: SysUtils.DateToStr

// BeginCode
{
This example uses three edit controls, a label, and a button
on a form. When the button is clicked, the day, month, and
year specified in the edit controls is stored in a TDateTime
object. Then the TDateTime object is converted to an
AnsiString that is displayed in the label.
} 
procedure TForm1.Button1Click(Sender: TObject);
var
  MyDate: TDateTime;
begin
  MyDate := SysUtils.EncodeDate(StrToInt(Edit1.Text), StrToInt(Edit2.Text), StrToInt(Edit3.Text));
  Label1.Caption := DateToStr(MyDate);
end;
// EndCode
// EndExample: EncodeDate
end.
