Progress
External Program
Interfaces
Navigating ActiveX Collections
ActiveX collections are COM objects that reference multiple instances of a particular class of COM object. Progress supports collection navigation by allowing you to access a COM object through the indexed Item property of the collection object:
In this example, the 4GL loops through all the worksheet objects in the Excel Application collection. Sheets is the collection and Item is the indexed property that returns the component handle to each Sheet object. The code uses the index (i) to loop through the total number of Sheet objects in the collection (ExcelApp:Sheets:Count( )), and assigns a unique name to each one ("ABC1", "ABC2", and so on).
NOTE: Collections are often named as a plural of the object class that they index. Thus, in this example, Sheets is the collection class and Sheet is the object class whose instances are indexed by the Item property of Sheets.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |