例如:procedure  test(i:integer);与proceudre  test(s:string);如何在一个类中共存

解决方案 »

  1.   

    procedure test(S:String);  overload;
    procedure test(I:Integer); overload;
      

  2.   

    delphi的机制决定delphi到运行前都不能确定与变量相关对象的实际类
    可以这样
    type
    Tanimal = class;
    public
     function voice : string; virtual;//将其定义为虚拟的然后在后面的定义中覆盖 TDog = class (Tanimal)
    public
      function voice:string; override;
    .
    .
    .
    function Tanimal.voice : string;
    begin
    end;function Tdog.voice:string;
    beign
    end;
      

  3.   

    调用的时候指定类就可以了
    比如
    labelvoice.caption := myanimal.voice;mastering d6对类讲的很好(至少我这么觉得),可以看看去
      

  4.   

    我以为很特殊呢,属于正常情况呀    procedure test(i:integer); overload;
        procedure test(i:string);overload;
      

  5.   

    drizzt123() 先答了,findcsdn(findcsdn) 只能少给点了