unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TBaseClass = class(TObject)
fSQL : TStrings;
private
function GetSQL: TStrings;
procedure SetSQL(const Value: TStrings);
public
{ Public declarations }
property
SQL : TStrings read GetSQL write SetSQL;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TBaseClass }
function TBaseClass.GetSQL: TStrings;
begin
Result:=fSQL;
end;
procedure TBaseClass.SetSQL(const Value: TStrings);
begin
fSQL:=Value;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
with TBaseClass.Create do begin
SQL:=ListBox1.Items;
SQL.Add('aa');
end;
end;
end.