1
0
lazarus-tutorials/first_gui/umain.pas
2021-10-08 14:32:29 -04:00

43 lines
560 B
ObjectPascal

unit umain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
DateBtn: TButton;
procedure DateBtnClick(Sender: TObject);
private
function TodayAsString: string;
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.DateBtnClick(Sender: TObject);
begin
ShowMessageFmt('Today is %s', [TodayAsString]);
end;
function TForm1.TodayAsString: string;
begin
Result := FormatDateTime('dddd, mmm d, yyyy', Now);
end;
end.