/*
EncodeTime example
This example uses four edit controls, a label, and a button on a form. When the button is clicked, the hour, minute, second, and millisecond 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.
*/ 
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  TDateTime dt;
  try
  {
    dt = EncodeTime((Word)StrToInt(Edit1->Text), (Word)StrToInt(Edit2->Text), (Word)StrToInt(Edit3->Text), (Word)StrToInt(Edit4->Text));
    Label1->Caption = TimeToStr(dt);
  }
  catch(...)
  {
    ShowMessage("Invalid hour, minute, second, or millisecond.");
  }
} 
