首页 > 技术文章 > Delphi中uses在interfeace和implementation中的区别

xumenger 2015-04-03 15:02 原文

use单元引入分为在interface中引入,如

interface
uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;

和在implementation,如

implementation
uses    clamsend;

  

区别简单的理解就是

  两个所在的声明位置不同,所以使用范围不同

  在interface下是全局的,在其他但原因如本单元的时候,这些单元也会被引入。

  在implementation下的就不是这样,它可以避免单元的循环引用

推荐阅读