unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
s =array of array of integer;
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
private
function test(arr:s):String;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
x: s;
begin
setlength(x,2,3);
x[0,0]:= 2;
x[0,1]:= 3;
x[0,2]:= 33;
x[1,0]:= 4;
x[1,1]:= 5;
x[1,2]:= 55;
self.Caption:= test(x);
end;
function TForm1.test(arr:s):String;
var i,j:integer;
str:String;
begin
str := '';
for i:= 0 to 1do
begin
for j:=0 to 2do
begin
str := str +'/'+ IntToStr(arr[j]);
showmessage('数组为:'+str);
end;
end;
result := str;
end;
end.