type 
  TA=class
  private
  B:TB//提示错误,该如何解决。我现在是用B:pointer;然后TB(B)强制转换 
end;type
  TB=class
end;

解决方案 »

  1.   

    这样试试:
    type
      TB=class
    end;type 
      TA=class
      private
      B:TB//提示错误,该如何解决。我现在是用B:pointer;然后TB(B)强制转换 
    end;
      

  2.   

    type
      TB = class;  TA = class
      private
       B:TB;
      end;  TB = class
      private
        a: Integer;
      end;
      

  3.   

    忘了说清楚
    TA和TB是一个单元中两个不同的类
    type
      TA=class
    ...其中要使用TB类型
    end;type
      TB=class
    ...其中要使用TA类型
    end;
    相互嵌套
      

  4.   

    还是hunterht(核桃-俺就是核桃的马甲)说得对
    其实开始我也是这样想的,只是每一个类型都有type,所以还是提示错误。
    type
      TB = class;type
      TA = class
      private
       B:TB;
      end;type
      TB = class
      private
        a: Integer;
      end;
      

  5.   

    还是hunterht(核桃-俺就是核桃的马甲)说得对
    其实开始我也是这样想的,只是每一个类型都有type,所以还是提示错误。
    type
      TB = class;type
      TA = class
      private
       B:TB;
      end;type
      TB = class
      private
        a: Integer;
      end;
    ====================================
     是你
    type
      TB = class;这里写错了。