delphi7 常见问题declaration expected but end of file found
procedureTForm1.FormPaint(Sender:TObject);varA,x1,y1,x2,y2:Double;D:integer;I:Integer...
procedure TForm1.FormPaint(Sender: TObject);
var
A,x1,y1,x2,y2:Double;
D:integer;
I:Integer;
E,M_PI:Double;
begin
D:=100;
M_PI:=3.1415926535897932;
for I:=0 to 720 do
begin
A:=I*M_PI/360;
E:=D*(1+sin(12*A));
x1:= 320+E*cos(A);
x2:=320+E*cos(A+M_PI/6);
y1:=240+E*sin(A);
y2:=240+E*cos(A+M_PI/6);
Canvas.MoveTo(Round(x1),Round(y1));
Canvas.LineTO(Round(x2),Round(y2));
end;
end;
不知道为什么会提示那样的错误? 展开
var
A,x1,y1,x2,y2:Double;
D:integer;
I:Integer;
E,M_PI:Double;
begin
D:=100;
M_PI:=3.1415926535897932;
for I:=0 to 720 do
begin
A:=I*M_PI/360;
E:=D*(1+sin(12*A));
x1:= 320+E*cos(A);
x2:=320+E*cos(A+M_PI/6);
y1:=240+E*sin(A);
y2:=240+E*cos(A+M_PI/6);
Canvas.MoveTo(Round(x1),Round(y1));
Canvas.LineTO(Round(x2),Round(y2));
end;
end;
不知道为什么会提示那样的错误? 展开
1个回答
展开全部
procedure TForm1.FormPaint(Sender: TObject);
var
A,x1,y1,x2,y2:Double;
D:integer;
I:Integer;
E,M_PI:Double;
begin
D:=100;
M_PI:=3.1415926535897932;
for I:=0 to 720 do
begin
A:=I*M_PI/360;
E:=D*(1+sin(12*A));
x1:= 320+E*cos(A);
x2:=320+E*cos(A+M_PI/6);
y1:=240+E*sin(A);
y2:=240+E*cos(A+M_PI/6);
Canvas.MoveTo(Round(x1),Round(y1));
Canvas.LineTO(Round(x2),Round(y2));
end;
end;
end. //是否是程序最后一行?需要加end.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询