Function declaration:
type
rDate = record
cdate: Byte;
cmonth: Byte;
cyears: Integer;
end;
function splitdate (Date: TDate): rDate;
var
date, month, year: Word;
begin
DecodeDate (date, year, month, date);
with Result do
begin
cdate = date;
cmonth: = month;
cyears: = yr;
end;
end;
Example of implementation:
procedure TForm1.Button1Click (Sender: TObject);
var
D: rDate;
begin
D: = splitdate(DateTimePicker1.Date);
with Memo1.Lines do
begin
Clear;
Add ('Date =' + IntToStr (D.cdate));
Add ('Month =' + IntToStr (D.cmonth));
Add ('Year =' + IntToStr (D.cyears));
end;
end;
No comments:
Post a Comment