QUOTE:
ASP VBScript 函数 之返回多个值 By shawl.qiu
1. 数组方式返回多个值
2. 类方式返回多个值
3. 字典方式返回多个值
shawl.qiu
2006-8-14
http://blog.csdn.net/btbtd
1. 数组方式返回多个值
2. 类方式返回多个值
3. 字典方式返回多个值
1. 数组方式返回多个值
2. 类方式返回多个值
3. 字典方式返回多个值
shawl.qiu
2006-8-14
http://blog.csdn.net/btbtd
1. 数组方式返回多个值
- linenum
- <% dim temp, ele
- temp="a,b,c,d,e"
- function fRtMltVal(str)
- fRtMltVal=split(str,",")
- end function
- for each ele in fRtMltVal(temp)
- response.write ele&"<br/>"
- next 'u als kn chc mlt ar //shawl.qiu
- %>
2. 类方式返回多个值
- linenum
- <%
- class cVnt
- public val
- public val1
- end class
- function fRtMltVal()
- set fRtMltVal= new cVnt
- fRtMltVal.val="...val..."
- fRtMltVal.val1="...val1..."
- end function 'shawl.qiu code
- response.write fRtMltVal.val&"<br/>"&fRtMltVal.val1
- %>
3. 字典方式返回多个值
- linenum
- <%
- function fRtMltVal()
- set dic=createObject("scripting.dictionary")
- dic.add "val", "...val"
- dic.add "val1", "...val1"
- dic.add "val2", "...val2"
- set fRtMltVal=dic
- end function : dim dic 'shawl.qiu code
- set dic= fRtMltVal()
- response.write dic("val")&"<br/>"
- response.write dic("val1")&"<br/>"
- response.write dic("val2")
- set dic=nothing
- %>