Set myList=CreateObject("System.Collections.ArrayList")

With myList
.Add("001")
.Add("002")
.Add("007")
.Add("004")
.Add("003")
.Add("009")
End With

msgbox myList.Item(2)

For i=0 to myList.count-1
msgbox myList.Item(i)
Next

myList.RemoveAt(2)

msgbox myList.Item(2)

myList.Insert 2,"007"

msgbox myList.Item(2)

myList.Sort

For i=0 to myList.count-1
msgbox myList.Item(i)
Next

运行结果依次为:

007

001 002 007 004 003 009

004

007

001 002 003 004 007 009

posted on 2011-11-01 09:50  testerZH  阅读(590)  评论(0编辑  收藏  举报