ObjectCollectionNext

Continues enumeration of a COM/OLE collection object.

Syntax:

ObjectCollectionNext( enumeration-handle)

Parameters:

(i) enumeration-handle an enumeration handle returned by ObjectCollectionOpen.

Returns:

(i) objecthandle COM/OLE object handle representing the next item in the collection, or 0 (zero) when finished enumerating the collection.

 

ObjectCollectionNext is now obsolete. Use ForEach to enumerate through an object collection.

Each time this function is called, it returns a COM/OLE object handle representing the next item in the collection. When enumeration is complete, it returns 0 (i.e., a NULL object handle).

 

Example:


objFSO = ObjectOpen("Scripting.FilesystemObject")
objDrives = objFSO.Drives
hEnum = ObjectCollectionOpen(objDrives)
While 1
   objDrive = ObjectCollectionNext(hEnum)
   If objDrive == 0 Then Break
   Message("", objDrive.Path)
   ObjectClose(objDrive)
EndWhile
ObjectCollectionClose(hEnum)
ObjectClose(objDrives)
ObjectClose(objFSO)
See Also:

ObjectCollectionOpen, ObjectCollectionClose, COM/OLE, ObjectOpen, ForEach