单元不能被循环引用(Circular unit reference)的。循环引用的意思是:A引用了B,而B又引用了A,且都是在interface部分进行引用。

example:

unit Unit1;

interface

uses

Unit2;

......

unit Unit2;

interface

uses Unit1;

......

此程序将不会被编译通过。

但是如果引用不全发生在interface部分,即至少有一个在implementation部分,则是允许的。因此,当你需要两个单元互相引用的时候,应该将其中的一个引用放置在implementation部分。

posted on 2014-06-26 16:23  Values  阅读(548)  评论(0编辑  收藏  举报