Delphi如何判断Tstringlist是否已create
1个回答
展开全部
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Memo2: TMemo;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
SrsList,DestList1,DestList2: TStringList;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
SrsList:=TStringList.Create;
SrsList.Add('a');
SrsList.Add('b');
SrsList.Add('*');
SrsList.Add('c');
SrsList.Add('d');
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
SrsList.Free;
end;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Memo2: TMemo;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
SrsList,DestList1,DestList2: TStringList;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
SrsList:=TStringList.Create;
SrsList.Add('a');
SrsList.Add('b');
SrsList.Add('*');
SrsList.Add('c');
SrsList.Add('d');
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
SrsList.Free;
end;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询