Reverseメソッド

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