且看这段代码:
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.
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.
解决方案 »
- 关于钩子链的问题,请求各位大哥帮忙。。。
- delphi 数据库恢复问题!急!高手速度潜入!!
- 请问在DELPHI中这样的代码该如何写?
- delphi写的服务器版用winsocket接收信息很慢的问题
- 如何向WORD,EXCEL中特定的地方插入从数据库中取出的数据?
- 高分求救。wise打包问题,谢谢
- 把Excel导入到SQL数据库中
- 关于*.MAP文件转换为图象,请教!!!
- 如何做到像winamp播放器那样移动窗口。
- ★★据了解搞底层开发比搞行业数据库管理软件开发容易,不知道大家有没有这种体会?★★
- 求《delphi构建进销存系统-POS系统开发实例》的源码
- delphi+汇编能否实现cpu指针强制跳转?
Result := pRightList[i, 0];
改为:
Result := pRightList[i, 1];
则编译通过,也就是说第二维下标不能从零开始。
是不是又是倒分贴?
你的array of 后面必须要跟类型名
你应该先把后面的东西定义成一个类型
type
WA=Array of WideString
WA=Array of WideStringfunction Pub_GetRightIDByRightName(const pRightList: WA;
const pRightName: WideString):WideString;