procedure InsertTable(DataArray:TwoArray;x,y:integer):overload;
procedure InsertTable(scrDataSet:TDataSet;x,y:integer):overload;通过上面的形式定义两个重载函数,但是通不过编译。
报错:[Error] UntWord.pas(249): Invalid compiler directive: 'OVERLOAD'怎么回事?

解决方案 »

  1.   

    下面这样都能运行,把你的相关代码贴出来看看,一定是有写错的地方,有可能你的TwoArray这些有问题,对了:
    你的TwoArray是什么。如果是数组,你就不能这样写,要换个写法。unit Unit1;interfaceuses Forms;type
      TForm1 = class(TForm)
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
        procedure add;overload;
        procedure add(test: integer);overload;
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.add;
    beginend;procedure TForm1.add(test: integer);
    begin
        
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
        add;
        add(1);
    end;end.
      

  2.   

    procedure InsertTable(DataArray:TwoArray;x,y:integer);overload;
    procedure InsertTable(scrDataSet:TDataSet;x,y:integer);overload;
    是分號, 不是冒號.
      

  3.   

    我也同意楼上。overload前一个应是分号.
      

  4.   

    不好意思我贴错了。那个我改过来了,是分号。
    TwoArray是我自己定义的动态二维数组类型。就是通不过编译。
      

  5.   

    哦,问题解决了。原来是在函数实现部分也加了overload