请问在接口部分和实现部分的引用有什么区别?
interface 
uses abc..
..
..implementationuses abc望指教,谢谢!

解决方案 »

  1.   

    那我在一个单元UnitA定义的数据结构,在另一个单元UnitB引用,应该放在哪里?是放在接口还是实现?
      

  2.   

    这要看你是在 Interface 还是 implementation 部分用到该数据结构了,在哪里用,就在哪里 use
      

  3.   

    还是不明白,比如我在UnitA定义的一个record:TArecord,当然是在implementation部分引用了,如果在implementation部分uses,编译不能通过的,说我没有定义TArecord?
      

  4.   

    TARecord 的类型声明应该在该单元(如 Unit1)的 interface 部分,因为其它单元要使用 TARecord另一单元中(如 Unit2),如果只在 implementation 中使用 TARecord,则在其中使用 uses Unit1;
      

  5.   

    在Interface中要用到另一个Unit里定义的数据,就在Interface里Use它,
    在implementation中同上,在implementation里Use它