unit B;interfaceuses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;type
  TForm2 = class(TForm)
    btn1: TButton;
    edt1: TEdit;
    procedure btn1Click(Sender: TObject);  private
    { Private declarations }
    strName: string;
    function GetstrName: string;
    procedure SetstrName(const value: string);  public
    { Public declarations }
    property proName: string read strName write strName;
  end;var
  Form2: TForm2;implementation{$R *.dfm}
function TForm2.GetstrName: string;
begin
  result := strName;
end;procedure TForm2.SetstrName(const value: string);
begin
  if (value = strName) then
  begin
    Exit;
  end
  else
  begin
    strName= value; //这里为什么会错??
  end;end;initialization// strname:='this default';end.