Abstract utility objects HandyCollection object
This object holds an array of items. Each item can be anything that the VARIANT type supports - objects, numeric values, strings, etc. It is not obligatory all items in the collection to be of same type. When you add an item to the collection, you assign it a key. You can index the item later by it. The key is also kept in VARIANT and the only restrictions that are put on it are that it must be unique in the collection and must be of such type that can be compared. So the key can also be object, numeric value or string.

Properties:

prop_r.GIF (130 bytes) Item - default, indexed property - retrieves an item from the collection by its key.

prop_r.GIF (130 bytes) Count - returns the items count.

prop_r.GIF (130 bytes) ItemByIndex - indexed property - retrieves an item by its numeric 1-based index in collection.

prop_r.GIF (130 bytes) _NewEnum - returns IEnumVariant interface. Standard property required to implement collection enumeration - never referred directly in the scripts. The returned enumerator contains the item's key values not the items themself!

Methods:

prop_r.GIF (130 bytes) Add - Adds new object to the end of collection.

prop_r.GIF (130 bytes) Clear - Removes all items from collection.

prop_r.GIF (130 bytes) Remove - Removes an item specified by its key.

prop_r.GIF (130 bytes) RemoveByItem - Removes an item specified by the item's itself.

prop_r.GIF (130 bytes) RemoveByIndex - Removes an item specified by its numeric 1-based index in collection.

prop_r.GIF (130 bytes) GetItemIndex - Evaluates the numeric index of an item specified by ite key.

prop_r.GIF (130 bytes) GetItemKey - Evaluates the key of an item specified by the item itself.

newObjects Copyright 2001-2006 newObjects [ ]