代码如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
Coll : TCollection;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
if Coll.Count < 0 then //运行时这里出错,非法读取地址 ,为何???
ShowMessage('小于0')
else
ShowMessage('大于等于于0');
end;end.不知道是什么原因????????
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
Coll : TCollection;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
if Coll.Count < 0 then //运行时这里出错,非法读取地址 ,为何???
ShowMessage('小于0')
else
ShowMessage('大于等于于0');
end;end.不知道是什么原因????????
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货