Carapace

COM Collections

A COM collection is, as the name implies, a collection of other objects. This collection can be extended -- by adding items -- or reduced. Unlike an Array, the position of an item within a collection can change -- for example, a new initial element can be inserted. In this way, a collection is similar to a Carapace List.

There are a few simple rules which an object must obey for it to be a well-behaved COM collection:

Click here for an example of a COM collection in Carapace.


Count

Count the items in the collection. This is of type Integer.


NewEnum

This property is used to allow COM to enumerate over the collection. It is a dummy property, since it is never set -- it simply exists so that COM knows that this object is to be treated as a collection.

The NewEnum property must be of type Unknown.


Item

Returns the specified item from the collection. Often collections are indexed by an Integer. Occasionally they are indexed by a String.

Arguments:

indexObject

Return type: Object


Contents Index Current topic: COM Related topics: objects, functions