unit fMain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure AppMsg(const sMsg : String);
  end;

var
  Form1: TForm1;

implementation

uses uClassDemo;

{$R *.dfm}

{ TForm1 }

procedure TForm1.AppMsg(const sMsg: String);
begin
  Edit1.Text := sMsg;
end;


procedure TForm1.Button1Click(Sender: TObject);
var
  anObj : TClass1;
begin
  anObj := TClass1.Create;
  try
    anObj.Foo;
    Edit2.Text := TClass1.Foo1;
  finally // wrap up
    FreeAndNil(anObj);
  end;    // try/finally
end;

end.
