TSL语言基础 > UNIT单元管理 > Unit的使用 > Uses子句

在unit中使用uses    

  •   在unit中有两个地方可以使用uses子句:interface,implementation,但uses字句必须紧跟在interface或implementation之后。
      使用uses子句后,被引用单元的接口函数可以在单元内使用,但在interface中定义的类的内联函数不能访问Implementation中uses子句引用的单元接口函数和类。
    Unit Unit1;
    Interface
    //Uses Unit1,Unit2....;//Uses statement
    //Function InterfaceFunction(); //place publish function header here
    Function func1();
    Begin
      //调用在unitB中定义的函数;
      FuncInUnitB();//Error:找不到该函数
    End;
    Implementation
    Uses UnitB;
    End.