46 lines
625 B
ObjectPascal
46 lines
625 B
ObjectPascal
|
unit maintest;
|
||
|
|
||
|
{$mode objfpc}{$H+}
|
||
|
|
||
|
interface
|
||
|
|
||
|
uses
|
||
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, dateform;
|
||
|
|
||
|
type
|
||
|
|
||
|
{ TForm1 }
|
||
|
|
||
|
TForm1 = class(TForm)
|
||
|
Button1: TButton;
|
||
|
procedure Button1Click(Sender: TObject);
|
||
|
private
|
||
|
|
||
|
public
|
||
|
|
||
|
end;
|
||
|
|
||
|
var
|
||
|
Form1: TForm1;
|
||
|
|
||
|
implementation
|
||
|
|
||
|
{$R *.lfm}
|
||
|
|
||
|
{ TForm1 }
|
||
|
|
||
|
procedure TForm1.Button1Click(Sender: TObject);
|
||
|
var d: TDateTime = 0;
|
||
|
begin
|
||
|
if GetDate(d) then
|
||
|
ShowMessageFmt(
|
||
|
'The date obtained via GetDate() was %s',
|
||
|
[FormatDateTime('dd/mm/yyyy', d)]
|
||
|
)
|
||
|
else
|
||
|
ShowMessage('The date entry dialog was cancelled or an invalid date was entered');
|
||
|
end;
|
||
|
|
||
|
end.
|
||
|
|