我想把一二维数组作为一函数的传入参数,该怎样实现?????多谢指点

解决方案 »

  1.   

    function test(AArray: array of integer);
      

  2.   

    fuction test(Arr: array of array of integer);
      

  3.   

    必须先自定义数组类型,比如type TMyArray=array [0..9] of Integer;procedure TForm1.Test( myArray: TMyArray);
    begin  //
    end;
      

  4.   

    在 delphi函数里好象不支持数组作为参数?不能声名
      

  5.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;
     type
     a=array of integer;
      type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        procedure abc(bb:a);{ Public declarations }
      end;
      var
      Form1: TForm1;
      aa:a;
    implementation{$R *.DFM}procedure tform1.abc(bb:a);
    begin
    showmessage(inttostr(bb[0]));
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
    setlength(aa,100);
    aa[0]:=123;
    abc(aa);
    end;end.
    完整实例!!结贴:)