W
wwwsinakok
Unregistered / Unconfirmed
GUEST, unregistred user!
程序要求我从1加到1000的结果,所以我就是触发事件begin和end之间输入以下程序
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
var
i,j:integer;
begin
i:=1; j:=0;
while i<=1000 do
begin
j:=j+i;
inc(i,1);
end;
statictext2.caption:=inttostr(j);
end;
end.
但是按F9运行时老是提示以下错误
[Error] Unit1.pas(31): Statement expected but 'VAR' found
[Error] Unit1.pas(40): Undeclared identifier: 'statictext2'
[Error] Unit1.pas(40): Missing operator or semicolon
[Error] Unit1.pas(42): '.' expected but ';' found
[Error] Unit1.pas(15): Unsatisfied forward or external declaration: 'TForm1.StaticText2Click'
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
var
i,j:integer;
begin
i:=1; j:=0;
while i<=1000 do
begin
j:=j+i;
inc(i,1);
end;
statictext2.caption:=inttostr(j);
end;
end.
但是按F9运行时老是提示以下错误
[Error] Unit1.pas(31): Statement expected but 'VAR' found
[Error] Unit1.pas(40): Undeclared identifier: 'statictext2'
[Error] Unit1.pas(40): Missing operator or semicolon
[Error] Unit1.pas(42): '.' expected but ';' found
[Error] Unit1.pas(15): Unsatisfied forward or external declaration: 'TForm1.StaticText2Click'
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'