Converting one of the answers there...
uses
SysUtils;
const
StartingYear = 2012;
var
Year,Month: Byte;
Date: TDateTime;
begin
for Year in [0 .. 5] do begin
for Month in [1 .. 12] do begin
Date := EncodeDate(Year,Month,13);
if DayOfWeek(Date) = 5 then begin
Sorry, missing one thing: Date := EncodeDate(StartingYear + Year,Month,13);
--
View this message in context:
http://free-pascal-general.1045716.n5.nabble.com/printing-each-Friday-the-13-using-Pascal-tp5710496p5710498.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
On 06/8/12 1:32, leledumbo wrote:
Minor amendment needed to leledumbo's code to give Friday, and a five
year range:
uses SysUtils;
const startYr: word = 2012;
var dt: TDateTime;
year, month: word;
begin
for year in [0..4] do
for month in [1..12] do
begin
dt :=