请教,delphi程序问题。
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;
var
Form1: TForm1;
count1:Integer;
// a,b,c:Integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
count1:=count1+1;
if (count1 mod 2=1) then
ListBox1.Items.Add('HELLO WORLD!');
else
ListBox1.Items.Add('HELLO FRIEND!');
end;
end.
后面的判断,我分别注释后都能显示出来,但是放一起就会报错。请问原因。