16,748
社区成员
发帖
与我相关
我的任务
分享
unit uArray;
interface
uses Windows, SysUtils;
type
TArray = array [0..2] of String;
function GetArray(var aArray : TArray) : Boolean;
implementation
function GetArray(var aArray : TArray) : Boolean;
begin
aArray[0] := 'Str1';
aArray[1] := 'Str2';
aArray[2] := 'Str3';
Result := True;
end;
end.
uses uArray;
var
aaa : TArray;
begin
if GetArray (aaa) then begin
Messagebox(0, pchar('返回:' + aaa[0] + ',' + aaa[1]),'提示', MB_OK);
end;
end;
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TintArray = array [0..2] of Integer;
TForm1 = class(TForm)
dxButton1: TButton;
private
{ Private declarations }
function GetArray :TintArray;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.GetArray;
var
intArray : TintArray;
begin
intArray[0] := 1;
intArray[1] := 2;
intArray[2] := 3;
Result := intArray;
end;
end.