| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3864 人关注过本帖
标题:Declaration expected but end of file found
只看楼主 加入收藏
josephzzq
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2007-3-18
收藏
 问题点数:0 回复次数:2 
Declaration expected but end of file found

这是我button1的代码,可以帮我修改一下吗?

unit Unit1;

interface

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

type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Query1: TQuery;
Query1BDEDesigner: TStringField;
Query1BDEDesigner2: TStringField;
Query1BDEDesigner3: TStringField;
Query1BDEDesigner4: TBooleanField;
Query1BDEDesigner5: TDateTimeField;
Query1BDEDesigner6: TSmallintField;
Query1BDEDesigner7: TMemoField;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.text=''then
begin
showmessage('请输入书名!');
abort;
end;
try
query1.DisableControls;
query1.close;
query1.paramByName('学号').value:='%'+edit1.text+'%';
query1.open;
finally
query1.EnableControls;
if query1.fieldByname('学号').value='' then
begin
showmessage('无书名!');
edit1.Clear;
end;
end;

end.


错误提示:[Error] Unit1.pas(56): ';' expected but '.' found
[Error] Unit1.pas(58): Declaration expected but end of file found
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'

搜索更多相关主题的帖子: Declaration found expected end file 
2007-04-15 17:57
zhongjinting
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2007-4-14
收藏
得分:0 
try...finall要以“end;”结束,你上面的代码少了一个“end;”
2007-04-15 18:59
josephzzq
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2007-3-18
收藏
得分:0 
哦,好的!谢谢
2007-04-15 19:45
快速回复:Declaration expected but end of file found
数据加载中...
 
   



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

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