反转整个 ArrayList 对象中元素的顺序。
语法
Object.Reverse()
参数 - Object:必需。始终为 ArrayList 对象的名称。
注释
以下示例说明了 Reverse 方法的用法。
示例 1:
'Create ArrayList Object
Dim Obj
Set Obj = CreateObject("System.Collections.ArrayList")
'Add Elements to the end of ArrayList Object
Dim Index
Index = Obj.Add(10)
Index = Obj.Add(40)
Index = Obj.Add(20)
Index = Obj.Add(30)
'Reverses the order of the elements in the entire ArrayList Object
Obj.Reverse()
'Output: Obj contains 30, 20, 40, 10