【发布时间】:2011-05-24 20:58:47
【问题描述】:
我有两个单位, 第一个,我的界面:
use personas
interface
type
Tllave = array[0..31] of byte;
Tdatos = array of byte;
ImyInterface = interface(IInterface)
function nombre : string;
function edad : integer;
procedure resetear;
function Proceso(datos : tdatos; cantidad : integer) : integer ;
procedure Iniciar(llave : Tllave);
end;
第二个单元,我的对象声明:
use militares
interface
uses personas;
type
Tmilitares = Class(TInterfacedObject, ImyInterface )
public
function nombre : string;
function edad : integer;
procedure resetear;
function Proceso(datos : Tdatos; cantidad : integer) : integer ;
procedure Iniciar(llave : Tllave);
published
constructor create;
end;
implementation
function tmilitares.Proceso(datos : tdatos; cantidad : integer) : integer ; // getting error !!
begin
// ....
end;
procedure tmilitares.Iniciar(llave : Tllave); // getting error!!
begin
// ....
end;
我只在“proceso”函数和“iniciar”程序中收到错误消息:
“Iniciar”声明与之前的声明不同
'Proceso' 的声明与之前的声明不同。
我注意到他们有数组参数。参数的类型在第一个单元中定义,如果我在第二个单元中定义这些类型,我会得到相同的错误,但它显示在对象的声明中。怎么编译?
【问题讨论】:
-
您没有向我们展示足够的细节。还有其他原因导致这些错误。
-
在第 1 行的两个 sn-ps 中必须有
uses,而不是use -
没有那些行应该说
unit
标签: arrays delphi interface parameters tinterfacedobject