leap year/de
From Free Pascal wiki
Jump to navigationJump to search
│
Deutsch (de) │
Dieses Beispiel prüft, ob das Jahr ein (christliches) Schaltjahr ab dem Jahr 1582 ist.
function funIstSchaltjahr(wrdJahr: word): integer;
const
conKalenderumstellung = 1583;
conFehler = -1;
conFalsch = 0;
conWahr = 1;
begin
Result := conFehler;
// Prüft auf die Richtigkeit des Kalenderjahres
if wrdJahr < conKalenderumstellung then
exit;
Result := conFalsch;
if (wrdJahr mod 4) = 0 then
Result := conWahr;
if (wrdJahr mod 100) = 0 then
Result := 0;
if (wrdJahr mod 400) = 0 then
Result := conWahr;
end;
--Olaf 10:47, 23 April 2013 (UTC)