为什么自定义过程,出错。说[Error] Unit2.pas(29): Undeclared identifier: 'NMFTP1'unit Unit2;(0

  • 主题发起人 yecloudy
  • 开始时间
Y

yecloudy

Unregistered / Unconfirmed
GUEST, unregistred user!
为什么自定义过程,出错。说[Error] Unit2.pas(29): Undeclared identifier: 'NMFTP1'unit Unit2;(0分)<br />为什么自定义过程,出错。说
[Error] Unit2.pas(29): Undeclared identifier: 'NMFTP1'unit Unit2;
下面是源码。请大家帮忙一下。
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Psock, NMFtp;
type
TForm2 = class(TForm)
NMFTP1: TNMFTP;
private
{ Private declarations }
public
{ Public declarations }
procedure a();
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure a();
begin
NMFTP1.port=21
end;
end.
 
Torm2.Nmftp1.prot ....
 
procedure TForm2.a;
begin
NMFTP1.port=21
end;
 
你的过程a(),是在Tform2的public单元申明的,就是TForm2方法,所以在实现部分
要如naughtboy所说的那样,加上TForm.。如果你在TForm2的申明以外申明,就不需要
加TForm.比如:
...
procedure a();
implementation
...
 
顶部