私は2つのユニットを持っています。最初の1つは私のインターフェースです:
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;
2 番目のユニット、私のオブジェクト宣言:
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' の宣言が以前の宣言と異なります。
配列パラメーターがあることに気付きました。パラメータの型は最初のユニットで定義されています。これらの型を 2 番目のユニットで定義すると、同じエラーが発生しますが、オブジェクトの宣言に表示されます。どうすればコンパイルできますか?