例如
有一记录类型如下
Type PTCellsType=record
     col:integer;
     row:integer;
end;如果是这个函数
procedure aa(NotCells :array of integer);
我调用是可以
   aa([1,2,3]);
这样传参那如果其参数为记录数组(如下),那我将如何按上述样式传参
procedure Cell(cells :array of PTCellsType);   Cell([????]);
谢谢!!!

解决方案 »

  1.   

    定义记录型变量
    P1,P2,P3:PTCellsType
    给变量赋值,然后就可传递差数了
    ///////////////
    要注意:传递的是记录型的指针
      

  2.   

    不能改成procedure Cell(cells :array[1..5] of PTCellsType);吗?
      

  3.   

    用指针
     Type pPTCellsType=^PTCellsType
    PTCellsType=record
         col:integer;
         row:integer;
    end;
    调用函数可以定义成procedure Cell(cells :pPTCellsType);
    调用:var aa: array of PTCellsType
           aa[0].col:=1;
           aa[0].row:=2;
           aa[1].col:=3;
           aa[1].row:=4;
              ........
    cell(@aa)   ;
    OK,给分吧
      

  4.   

    to lonaerd(罗纳尔多) 
    pPTCellsType只是记录的指针,而不是记录数组的指针,所以是错的。
      

  5.   

    to snowfog(秋风舞):
    怎么会错的呢?我都用了很久了,我现在写的一个程序都是记录数组。
    cell(@aa) 传递的就是树组的地址,哪里错了? 
      

  6.   

    to lzybfs(白字先生) :永远用变量的程序员不是真正的程序员。DELPHI中的指针我觉得比C要好理解一些,特别在VC中看得很累;你不妨试一下
      

  7.   

    既然是常量,那就先定义常量吧:
    const
      a1:PTCellsType=(col:10;row:10);
      a2:PTCellsType=(col:11;row:11);
      a3:PTCellsType=(col:11;row:13);Cell([a1,a2,a3]);
      

  8.   

    hiflower(花) 理解我的意思了,谢谢!
    能不能在简洁点
    (能不能用一行语句解决)
      

  9.   

    hiflower(花) 理解我的意思了,谢谢!
    能不能在简洁点
    (能不能用一行语句解决)太贪心了!花儿的方法不是挺好摩?
    414
    Cell([(col:10;row:10),(col:10;row:10),(col:10;row:10)]);
    Cell([(PTCellsType)(col:10;row:10),(PTCellsType)(col:10;row:10),(PTCellsType)(col:10;row:10)]);
    Cell([PTCellsType(col:10;row:10),PTCellsType(col:10;row:10),PTCellsType(col:10;row:10)]);
    或者什么其他的。 :P
      

  10.   

    不能了,Delphi 不支持赋值语句中这样写