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
---------------------------------------------------------------
AUTHOR:testerZH
用途:菜鸟的个人学习记录,有不对的地方请指正!谢谢!
出处:http://www.cnblogs.com/testerZH/