我想重载一个类中的过程.
为此,我写道:
为此,我写道:
type TMyClass = class(TObject) private... ... public constructor create; destructor destroy; procedure dosomething(filename: string); overload; procedure dosomething(s: string; t: string; u: string); overload; implementation procedure dosomething(filename:string); begin end; procedure dosomething(s: string; t: string; u: string); begin end;
这是为什么?
提前致谢!
解决方法
你必须添加类名…
implementation procedure TMyClass.dosomething(filename:string); begin end; procedure TMyClass.dosomething(s: string; t: string; u: string); begin end;