Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.03.18;
Скачать: CL | DM;

Вниз

Несколько модулей в одном проекте.   Найти похожие ветки 

 
Danila_master ©   (2007-02-26 17:05) [0]

Помогите разобраться, где ошибка.
Есть основной модуль:
unit CC;
interface
uses
 SysUtils, Classes, AC;
type
 TAoI = array of integer;

 calcCenter = class
 public
   constructor Create;
   destructor Destroy; override;
   procedure calculate(size: TAoI);
 private
   contour: ActiveContour;
 end;
implementation
constructor calcCenter.Create;
begin
...
end;
destructor calcCenter.Destroy;
begin
...
end;
procedure calcCenter.calculate(size: TAoI);
var
 size1: TAoI;
begin
 SetLength(size1, 2);
 size1[0] := 512;
 size1[1] := 512;
 contour.setSize(size1);
end;
end.

и модуль с классом:
unit AC;
interface
uses
 SysUtils, Classes;
type
 TAoI = array of integer;
 ActiveContour = class
 public
   constructor Create;
   destructor Destroy; override;
   procedure setSize(size: TAoI);
 private
    _size: array of Integer;
 end;
implementation
constructor ActiveContour.Create;
begin
...
end;
destructor ActiveContour.Destroy;
begin
...
end;
procedure ActiveContour.setSize(size: TAoI);
begin
 _size[0] := size[0];
 _size[1] := size[1];
end;

и вадает ошибку:
"CC.pas(159): E2010 Incompatible types: "AC.TAoI" and "CC.TAoI""
Никак не могу понять, где ошибка?


 
Аноним   (2007-02-26 17:08) [1]

Ты вообще зачем в двух модулях одинаковые типы объявил?
TAoI = array of integer;

оставь только один, и будет счастье


 
Darvin ©   (2007-02-26 17:08) [2]

unit Types
 ...
 TIntegerDynArray = array of Integer;


 
Danila_master ©   (2007-02-26 17:19) [3]

Сделал как советовали, создал новый модуль:
unit Types;
interface
type
 TAoI = array of integer;
implementation
end.

во всех модулях добавил:
uses
 SysUtils, Classes, AC, EF, Types;

Теперь выдает новые ошибки:
[Pascal Error] AC.pas(36): E2003 Undeclared identifier: "TAoI"
[Pascal Error] AC.pas(228): E2008 Incompatible types
ну и так далее. Что я опять сделал не так?


 
Аноним   (2007-02-26 17:48) [4]


> Danila_master ©


ты не понял
Модуль Types уже существует, в VCL
а в нем уже есть тип

TIntegerDynArray = array of Integer;

можно подключить его в Uses и использовать TIntegerDynArray  вместо TAoI


 
trubin ©   (2007-02-26 19:54) [5]

Можно явно указывать имена модулей: AC.TAoI и СC.TAoI



Страницы: 1 вся ветка

Текущий архив: 2007.03.18;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.044 c
2-1172267824
arccis
2007-02-24 00:57
2007.03.18
закрытие и автозагрузка


2-1172502886
Washington
2007-02-26 18:14
2007.03.18
Определение даты у записи


15-1172123463
Брюнетка
2007-02-22 08:51
2007.03.18
С Днем Защитника Отечества!


6-1159773492
MZUser
2006-10-02 11:18
2007.03.18
Выполнение PHP скрипта в WebBrowser


15-1172076223
Ламот
2007-02-21 19:43
2007.03.18
Win2k server + 1С 7.7 + MS SQL