main.pas
-------------------------------------
unit main;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,TFoo;
……………………procedure TForm1.Button1Click(Sender: TObject);begin
  ShowMessage('NO');
  tFoo.Create;
  ShowMessage('OK"');
  tFoo.a:=  123;
  ShowMessage(IntToStr(tFoo.a));
  tFoo.Free;
end;end.
------------------------------------------------
TFoo.pas
--------------------------------------------------
unit TFoo;interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;type
TFooa = class
private
Fa:integer;
function GetA() : Integer;
procedure SetA(a : Integer);
published
property a : Integer read GetA write SetA;
end;implementationfunction TFooa.GetA() : Integer;
begin
result :=Fa;
end;procedure TFooa.SetA(a : Integer);
begin
Fa :=a;
end;
end.
------------------------------------
程序运行到
tFoo.Create;
就出错了。不知道是为什么。