例: getFirst メソッド (JavaPropertyCollection クラス)

次のスクリプトは、コレクション内での MAX_VALUE の位置を出力します。

Dim mySession As JavaSession
Dim myClass As JavaClass
Dim myProperty As JavaProperty
Dim myPCollection As JavaPropertyCollection
	
Set mySession = new JavaSession()

' Get Java "java.lang.Integer" class
Set myClass = mySession.GetClass("java/lang/Integer")

' Get a list of all methods belonging
' to the java.lang.Integer class
Set myPCollection = myClass.getClassProperties()

Set myProperty = myPCollection.getFirst()
Do
	If myProperty.PropertyName = "MAX_VALUE" then
		Print "MAX_VALUE is located at the " & _
      myPCollection.current _
		& " position within the collection"
		Exit Do
	End If
	Set myProperty = myPCollection.getNext()

Loop While myPCollection.Current <> 1
' Because getNext loops back to 1 when the end is reached