求高手delphi7问题! [Error] Unit1.pas(62): Declaration expected but end of file found
procedureTForm1.Button1Click(Sender:TObject);VarnMonth,nDay,nYear,nDayInYear,nM:Integ...
procedure TForm1.Button1Click(Sender: TObject);
Var
nMonth ,nDay ,nYear ,nDayInYear, nM:Integer;
begin
nYear :=SpinEdit1.Value ;
nMonth :=SpinEdit2.Value ;
nDAY :=SpinEdit3.Value ;
nDayInYear :=0;
For nM :=1 to nMonth-1 do
begin
Case nM of
4,6,9,11:nDayInYear :=nDayInYear +30;
2:
begin
nDayInYear :=nDayInYear +28;
if ((nYear mod 4)=0) and ((nYear mod 100)<>0) then
Inc (nDayInYear);
end;
else
nDayInYear :=nDayInYear+31;
end;
end;
nDayInYear:=nDayInYear+nDay;
Label5.Caption :='该天是本年中第' +InttoStr(nDayInYear)+'天';
end;
错误:
[Error] Unit1.pas(62): Declaration expected but end of file found
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
问题出在哪啊!妹按一次运行,光标自动下一行,[Error] Unit1.pas(62): 就自动加1??? 展开
Var
nMonth ,nDay ,nYear ,nDayInYear, nM:Integer;
begin
nYear :=SpinEdit1.Value ;
nMonth :=SpinEdit2.Value ;
nDAY :=SpinEdit3.Value ;
nDayInYear :=0;
For nM :=1 to nMonth-1 do
begin
Case nM of
4,6,9,11:nDayInYear :=nDayInYear +30;
2:
begin
nDayInYear :=nDayInYear +28;
if ((nYear mod 4)=0) and ((nYear mod 100)<>0) then
Inc (nDayInYear);
end;
else
nDayInYear :=nDayInYear+31;
end;
end;
nDayInYear:=nDayInYear+nDay;
Label5.Caption :='该天是本年中第' +InttoStr(nDayInYear)+'天';
end;
错误:
[Error] Unit1.pas(62): Declaration expected but end of file found
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
问题出在哪啊!妹按一次运行,光标自动下一行,[Error] Unit1.pas(62): 就自动加1??? 展开
展开全部
procedure TForm1.Button1Click(Sender: TObject);
Var
nMonth ,nDay ,nYear ,nDayInYear, nM:Integer;
begin
nYear :=SpinEdit1.Value ;
nMonth :=SpinEdit2.Value ;
nDAY :=SpinEdit3.Value ;
nDayInYear :=0;
For nM :=1 to nMonth-1 do
begin
Case nM of
4,6,9,11:nDayInYear :=nDayInYear +30;
2:
begin
nDayInYear :=nDayInYear +28;
if ((nYear mod 4)=0) and ((nYear mod 100)<>0) then
Inc (nDayInYear)
else
nDayInYear :=nDayInYear+31;
end;
end;
end;
nDayInYear:=nDayInYear+nDay;
Label5.Caption :='悄粗派该天是本凳信年中第启贺' +InttoStr(nDayInYear)+'天';
end;
Var
nMonth ,nDay ,nYear ,nDayInYear, nM:Integer;
begin
nYear :=SpinEdit1.Value ;
nMonth :=SpinEdit2.Value ;
nDAY :=SpinEdit3.Value ;
nDayInYear :=0;
For nM :=1 to nMonth-1 do
begin
Case nM of
4,6,9,11:nDayInYear :=nDayInYear +30;
2:
begin
nDayInYear :=nDayInYear +28;
if ((nYear mod 4)=0) and ((nYear mod 100)<>0) then
Inc (nDayInYear)
else
nDayInYear :=nDayInYear+31;
end;
end;
end;
nDayInYear:=nDayInYear+nDay;
Label5.Caption :='悄粗派该天是本凳信年中第启贺' +InttoStr(nDayInYear)+'天';
end;
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
检查一下,BEGIN和end是否成对。这段代码本身应该没有什么问题。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
差end
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询