1、type tarr= array of array of integer; type TForm1 = class(TForm) private { Private declarations } public { Public declarations } procedure setdata(arr:tarr); end; var Form1: TForm1; implementation{$R *.DFM}{ TForm1 }procedure TForm1.setdata(arr:tarr); beginend;
呵呵,Crob已经回答得很完善了,没什么可说的……
1。在DELPHI中进行数组传递要注意它们之间的关系,我们一般要这样做 声明一个类型 type simm=array[0..10] of integer; 在被调用端和调用端的声明里都用simm做为类型; 2。正在调试 3。很奇怪,没见过类似的情况。 4。程序增大,内存也会相应增加; 5。引用为var,而不是out,out其实是在typelibrary里对应IDL才有的东东; 6。同意楼上
补充一点上面的5 out只能为output,而不能为input,虽然也有一点引用的说法 让我们看看原文 An out parameter, like a variable parameter, is passed by reference. With an out parameter, however, the initial value of the referenced variable is discarded by the routine it is passed to. The out parameter is for output only; that is, it tells the function or procedure where to store output, but doesn抰 provide any input.
tarr= array of array of integer;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
procedure setdata(arr:tarr);
end;
var
Form1: TForm1;
implementation{$R *.DFM}{ TForm1 }procedure TForm1.setdata(arr:tarr);
beginend;
type simm=array[0..10] of integer; 在被调用端和调用端的声明里都用simm做为类型;
2。正在调试
3。很奇怪,没见过类似的情况。
4。程序增大,内存也会相应增加;
5。引用为var,而不是out,out其实是在typelibrary里对应IDL才有的东东;
6。同意楼上
out只能为output,而不能为input,虽然也有一点引用的说法
让我们看看原文
An out parameter, like a variable parameter, is passed by reference. With an out parameter, however, the initial value of the referenced variable is discarded by the routine it is passed to. The out parameter is for output only; that is, it tells the function or procedure where to store output, but doesn抰 provide any input.