For Newbie

Wednesday, 16 November 2011

Calculating century - n by a certain date.

Function declaration:
centurycalculate function (const d: TDate): Word;
var
   tg, bl, th: Word;
begin
   DturecodeDate (D, th, bl, tg);
   Result: = th p 100;
end;

Example of implementation:
procedure TForm1.Button1Click (Sender: TObject);
var
   d: TDate;
begin
   d: = DateTimePicker1.Date;
   with Memo1.Lines do
   begin
     Clear;
     Add ('Date' + DateToStr (d) + 'located in the century -' +
         IntToStr (HitungAbad (d)));
   end;
end;

Share on Facebook
Share on Twitter
Share on Google+

Related : Calculating century - n by a certain date.