且看这段代码:
function Pub_GetRightIDByRightName(const pRightList: array of WideString;
  const pRightName: WideString):WideString;
var
  i: Integer;
begin
  for i := Low(pRightList) to High(pRightList) do
    if UpperCase(pRightList[i, 1]) = UpperCase(pRightName) then
    begin
      Result := pRightList[i, 0];  //这一步编译报错:Element 0 inacessible - use 'length' or 'SetLength'
      Break;
    end;
end;
其中pRightList是一个二维数组,如果在函数声明中定义pRightList为二维变量数组:pRightList: Array of Array of WideString.则编译报错:identtifier expected but 'array'found.

解决方案 »

  1.   

    如果将
    Result := pRightList[i, 0]; 
    改为:
    Result := pRightList[i, 1]; 
    则编译通过,也就是说第二维下标不能从零开始。
      

  2.   

    解决方法:查看Delphi帮助:array parameters。谢谢。
      

  3.   

    怎么一个人问一个答阿
    是不是又是倒分贴?
    你的array of 后面必须要跟类型名
    你应该先把后面的东西定义成一个类型
    type 
    WA=Array of WideString
      

  4.   

    type
      WA=Array of WideStringfunction Pub_GetRightIDByRightName(const pRightList: WA;
      const pRightName: WideString):WideString;