日期:2014-05-16  浏览次数:20795 次

大虾们 问个简单的问题 请帮我看看
下面这个函数是什么意思??

Dim opTable(10000,2) '输出参数表
public opLen '输出参数长度

Function GetResultParam(pName,pValue)
for i=0 to opLen-1
if lcase(opTable(i,0)) = lcase(pName) then
pValue = opTable(i,1)
exit for
end if
next
end Function 

------解决方案--------------------
比较一下,数组里的元素的第一个,如果符合pName,就是找到。然后返回,退出。
if lcase(opTable(i,0)) = lcase(pName) then
   pValue = opTable(i,1)
   exit for
end if

------解决方案--------------------
Dim opTable(10000,2) '输出参数表
public opLen '输出参数长度

Function GetResultParam(pName,pValue)
for i=0 to opLen-1
if lcase(opTable(i,0)) = lcase(pName) then
pValue = opTable(i,1)
exit for
end if
next
end Function 
传递二个参数与数组(opTable)中的值对比,如果存在就取出pValue就结束,值否则对比下一个直到结束。