展会信息港展会大全

ASP中的ArrayList类
来源:互联网   发布日期:2016-03-01 11:05:04   浏览:1911次  

导读:使用方法如下: 程序代码 % 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...

使用方法如下:

程序代码

<%

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

%>

赞助本站

人工智能实验室

相关热词: 开发 编程 android

AiLab云推荐
推荐内容
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港