当前位置: 代码迷 >> ASP >> 们 问个简单的有关问题 请帮小弟我看看
  详细解决方案

们 问个简单的有关问题 请帮小弟我看看

热度:438   发布时间:2013-01-01 14:04:20.0
大虾们 问个简单的问题 请帮我看看
下面这个函数是什么意思??

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就结束,值否则对比下一个直到结束。
  相关解决方案