Count 메소드

ArrayList 객체에 실제로 포함된 요소 수를 가져옵니다.

구문

Object.Count()

Arguments - Object: 필수 항상 ArrayList 객체의 이름입니다.

반환

ArrayList 객체에 실제로 포함된 요소 수

주석

다음 예에서는 Count 메소드의 사용을 보여 줍니다.

예 1:

'Create ArrayList Object
Dim Obj
Dim Cnt
Set Obj = CreateObject("System.Collections.ArrayList")

'Add Elements to the end of the ArrayList Object
Dim Index
Index = Obj.Add(10)
Index = Obj.Add(40)
Index = Obj.Add(20)
'Gets the number of elements actually contained in the ArrayList object.
Cnt = Obj.Count()  
'Output: 3