| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1482 人关注过本帖
标题:[Error] Unit1.pas(101): Declaration expected but end of file found
只看楼主 加入收藏
zy0800840207
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-7-31
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
[Error] Unit1.pas(101): Declaration expected but end of file found
要怎么调试呢?
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    RadioGroup1: TRadioGroup;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure Label1Click(Sender: TObject);
    procedure RadioGroup1Click(Sender: TObject);
  private
    { Pr
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
if RadioGroup1.ItemIndex=0 then
begin
Label1.Caption :='整数类型:'+'Integer';
Label2.Caption :='占用字节数:'+IntToStr(SizeOf (Integer));
Label3.Caption :='取值上限:' + IntToStr(High (Integer));
Label4.Caption :='取值下限:' + IntToStr(Low (Integer));
end;
if RadioGroup1.ItemIndex=1 then
begin
Label1.Caption :='整数类型:'+'Cardinal';
Label2.Caption :='占用字节数:'+IntToStr(SizeOf (Cardinal));
Label3.Caption :='取值上限:'  +IntToStr(High (Cardinal));
Label4.Caption :='取值下限:'  +IntToStr(Low (Cardinal));
end;
if RadioGroup1.ItemIndex=2 then
begin
Label1.Caption :='整数类型:'+'Shortint';
Label2.Caption :='占用字节数:'+IntToStr(SizeOf (Shortint));
Label3.Caption :='取值上限:' + IntToStr(High (Shortint));
Label4.Caption :='取值下限:' + IntToStr(Low (Shortint));
end;
if RadioGroup1.ItemIndex=3 then
begin
Label1.Caption :='整数类型:'+'Smallint';
Label2.Caption :='占用字节数:'+IntToStr(SizeOf (Smallint));
Label3.Caption :='取值上限:'  +IntToStr(High (Smallint));
Label4.Caption :='取值下限:'  +IntToStr(Low (Smallint));
end;
if RadioGroup1.ItemIndex=4 then
begin
Label1.Caption :='整数类型:'+'Longint';
Label2.Caption :='占用字节数:'+IntToStr(SizeOf (Longint));
Label3.Caption :='取值上限:' + IntToStr(High (Longint));
Label4.Caption :='取值下限:' + IntToStr(Low (Longint));
end;
if RadioGroup1.ItemIndex=5 then
begin
Label1.Caption :='整数类型:'+'Int64';
Label2.Caption :='占用字节数:'+ IntToStr(SizeOf (Int64));
Label3.Caption :='取值上限:'+  IntToStr(High (Int64));
Label4.Caption :='取值下限:'+ IntToStr(Low (Int64));
end;
if RadioGroup1.ItemIndex=6 then
begin
Label1.Caption :='整数类型:'+'Byte';
Label2.Caption :='占用字节数:'+ IntToStr(SizeOf (Byte));
Label3.Caption :='取值上限:'+  IntToStr(High (Byte));
Label4.Caption :='取值下限:'+  IntToStr(Low (Byte));
end;
if RadioGroup1.ItemIndex=7 then
begin
Label1.Caption :='整数类型:'+'Word';
Label2.Caption :='占用字节数:'+ IntToStr(SizeOf (Word));
Label3.Caption :='取值上限:' + IntToStr(High (Word));
Label4.Caption :='取值下限:'+ IntToStr(Low (Word));
end;
if RadioGroup1.ItemIndex=8 then
begin
Label1.Caption :='整数类型:'+'LongWord';
Label2.Caption :='占用字节数:'+ IntToStr(SizeOf (LongWord));
Label3.Caption :='取值上限:'+  IntToStr(High (LongWord));
Label4.Caption :='取值下限:'+  IntToStr(Low (LongWord));
end;
end;
编译错误如下:
[Error] Unit1.pas(101): Declaration expected but end of file found
[Error] Unit1.pas(16): Unsatisfied forward or external declaration: 'TForm1.Label1Click'
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'
搜索更多相关主题的帖子: Declaration found expected end 
2010-10-11 20:59
ljm1979
Rank: 2
等 级:论坛游民
帖 子:5
专家分:29
注 册:2010-4-1
收藏
得分:20 
1。把procedure Label1Click(Sender: TObject);过程删除掉,没有用。
2。private
    { Pr
变为
 private
    { Private declarations }
3。注意看看你的begin。。end 是不是有多余的,注意一下就可以了
2010-10-18 16:55
快速回复:[Error] Unit1.pas(101): Declaration expected but end of file foun ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033715 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved