//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "IsLeapYear.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: IsLeapYear
// Routine: SysUtils.IsLeapYear

// BeginCode
/*
This example requires a button and a text edit. When the
user presses the button a message indicates if the year
specified in the text edit is a leap year.
*/
bool __fastcall IsThisLeapYear(int year)
{
  return IsLeapYear(year);
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  int year = StrToInt(Edit1->Text);
  if (IsThisLeapYear(year))
	ShowMessage(Edit1->Text + " is a leap year.");
  else
	ShowMessage(Edit1->Text + " is not a leap year.");
}
// EndCode
// EndExample: IsLeapYear
//---------------------------------------------------------------------------
