简单问题,可我不明白(50分)

Y

Yves

Unregistered / Unconfirmed
GUEST, unregistred user!
function TControlGrp.Connect(): TResult
overload;//报错
begin
try

except
end;
end;

function TControlGrp.Connect(RemotePort : integer
IPAddress : string): TResult
overload;//报错
begin

try
except
end;
end;
编译器报错
Invalid complier directive :'OVRELOAD'
Invalid complier directive :'OVRELOAD'
我查过delphi 的帮助 也不知是什么错?
大家帮帮忙
 
你有没有声明这两个函数?
 
这个当然声明了
 
OverLoad写在接口部分就行了,实现部分还写来干什么
 
不是吧?
delphi 帮助原文
You can declare more than one routine in the same scope with the same name. This is called overloading. Overloaded routines must be declared with the overload directive and must have distinguishing parameter lists. For example, consider the declarations

function Divide(X, Y: Real): Real
overload;

begin
Result := X/Y;
end;

function Divide(X, Y: Integer): Integer
overload;

begin
Result := X div Y;
end;


 
信你的,通过编译
不过这个 帮助中的例子?
 
基本常识
你在声明的地方按
ctrl+shift+c
会自动给出框架,你看有没有overload
 
实现的部分是不要overload的。
 
Invalid complier directive :'OVRELOAD'
你的单词拼错了
'OVRELOAD'
应为
'OVERLOAD'
 
Invalid complier directive :'OVRELOAD'
无效的编译器指示字:'OVRELOAD'

呵呵, 确实拼错了
 
楼上,如果是因为拼错了会提示 Invalid complier directive 吗?
所以只是楼主发帖时拼错了而已

 
是我 发帖时拼错了 多谢诸位了,一时拧住了
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
589
import
I
I
回复
0
查看
693
import
I
I
回复
0
查看
623
import
I
顶部