已经声明过的组件怎么不能编译?

shijies 2009-01-21 04:32:14
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, mmsystem, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdMessageClient, IdPOP3, ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Button1: TButton;
Timer1: TTimer;
IdPOP31: TIdPOP3;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
i,FMsgCount:integer;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
if IdPOP31.Connected then
begin
IdPOP31.Disconnect;
end;
edit4.Text:='';
end;
IdPOP31.Host:=edit1.text;
IdPOP31.Username:=edit2.text;
IdPOP31.Password:=edit3.text;

IdPOP31.Connect;
FMsgCount:=IdPOP31.CheckMessages;
i:=FMsgCount;
if FMsgCount>0 then
begin
label1.caption:='邮箱中没有新邮件...';
end
else
begin
showmessage('No messages on server');
end;
IdPOP31.disConnect;
timer1.Enabled:=true;
end;

procedure TForm1.Timer1Timer(Sender:TObject);
begin
IdPOP31.Connect;
if (IdPOP31.CheckMessages>FMsgCount) then
begin
label1.caption:='有新邮件...';
FMsgCount:=IdPOP31.CheckMessages;
edit4.Text:=inttostr(FMsgCount-1);
end;
IdPOP31.DisConnect;
end;
end.

[Error] Unit1.pas(42): Declaration expected but identifier 'IdPOP31' found
[Error] Unit1.pas(51): Undeclared identifier: 'label1'
[Error] Unit1.pas(53): '.' expected but 'ELSE' found
[Error] Unit1.pas(54): Identifier redeclared: 'Finalization'
[Warning] Unit1.pas(56): Text after final 'END.' - ignored by compiler
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
...全文
45 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
mandarin 2009-01-21
  • 打赏
  • 举报
回复
貌似少了个end
bdmh 2009-01-21
  • 打赏
  • 举报
回复
整理一下代码吧,太乱了
Corn1 2009-01-21
  • 打赏
  • 举报
回复
IdPOP31.Host:=edit1.text;
IdPOP31.Username:=edit2.text;
IdPOP31.Password:=edit3.text;

IdPOP31.Connect;
FMsgCount:=IdPOP31.CheckMessages;
i:=FMsgCount;
if FMsgCount>0 then
begin
label1.caption:='邮箱中没有新邮件...';
end
else
begin
showmessage('No messages on server');
end;
IdPOP31.disConnect;
timer1.Enabled:=true;
end;

这段话你是写在哪儿的?上面那个Button1Click过程都结束了...

5,391

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧