Description |
The IsLeapYear function returns true if a given calendar value is a leap year.
Year can have a value 0..9999
|
|
Related commands |
|
|
|
Example code : Was the year 2000 a leap year? |
// Full Unit code. // ----------------------------------------------------------- // You must store this code in a unit called Unit1 with a form // called Form1 that has an OnCreate event called FormCreate. unit Unit1; interface uses SysUtils, // Unit containing the IsLeapYear command Forms, Dialogs; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} // Include form definitions procedure TForm1.FormCreate(Sender: TObject); begin
if IsLeapYear(2000)
then ShowMessage('2000 was a leap year')
else ShowMessage('2000 was not a leap year');
end; end.
|
Hide full unit code |
2000 was a leap year
|
|