unit GG;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Timer1: TTimer;
IdHTTP1: TIdHTTP;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function zhonghang():string;
begin
with TStringList.Create do try
Text := IdHTTP1.Get('http://www.xxx.com');
if Count > 2 then
begin
edit1.Text:= Copy(Strings[Count - 2], 0, 8);
edit2.Text:= Copy(Strings[Count - 2], 0, 8);
end;
finally
Free;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
zhonghang();
end;
end.
错误:
[Error] GGold.pas(47): Undeclared identifier: 'IdHTTP1'
[Error] GGold.pas(50): Undeclared identifier: 'edit1'
[Error] GGold.pas(51): Undeclared identifier: 'edit2'
这段不对了??
找不到控件,
函数放错位置了?