龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > asp编程 >

ASP中的ArrayList类[数组常用函数]

时间:2012-12-31 22:56来源:未知 作者:admin 点击:
分享到:
ASP中的ArrayList类[数组常用函数] 使用方法如下: 程序代码 % dim arr : set arr=new ArrayList arr.add a : arr.add b : arr.add c Response.Write arr.count br for i=0 to arr.count-1 Response.Write arr.item(i) br next set arr=n

ASP中的ArrayList类[数组常用函数]

使用方法如下:

 程序代码
<%
dim arr : set arr=new ArrayList
arr.add "a" : arr.add "b" : arr.add "c"
Response.Write arr.count & "<br>"
for i=0 to arr.count-1
    Response.Write arr.item(i) & "<br>"
next
set arr=nothing
%>

Class ArrayList
Private m_array()
Private m_count
Private Sub Class_Initialize()
    Redim m_array(0)
    m_count=0
End Sub
Private Sub Class_Terminate()
    Redim m_array(0)
    m_count=0
End Sub
Public Property Get Count()
    Count=m_count
End Property
Public Property Get Item(index)
    Item=m_array(index)
End Property
Public Function Add(arrItem)
    Redim Preserve m_array(m_count)
    m_array(m_count)=arrItem
    m_count=m_count+1
End Function
End Class
%>


精彩图集

赞助商链接