Главная страница
    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.45 MB
Время: 0.037 c
15-1171798982
Чапаев
2007-02-18 14:43
2007.03.18
что для вас иконка в трее (там где часы)?


15-1172311499
Moonglow
2007-02-24 13:04
2007.03.18
Кто из Питера? Очень нужна помощь!


6-1160052302
Прохожев М
2006-10-05 16:45
2007.03.18
Письма с вложением


3-1166968045
gekakos
2006-12-24 16:47
2007.03.18
не могу отсортироватьв DBGrid....


2-1172596618
ы
2007-02-27 20:16
2007.03.18
классы и записи





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский