Specifications

2-14 Automation Syntax
2-14
collection object contains a set of properties and methods for
navigating and manipulating the objects in the collection.
The most commonly used properties are:
Index. The Index property takes in a name and returns
a number value associated with the object’s name.
Item. The Item property takes an index value or name
or integer number as the argument and returns a
reference to the object within the collection.
Count. The Count property returns the number of items
in the collection.
A special type of For loop, called For Each, is available for
enumerating through the objects within the collection. The For
Each loop provides a means for enumerating through the
collection without explicitly specifying how many items are in
the collection. This helps avoid having to make additional
function calls to the Count and Item properties of the collection
object in order to perform the same type of loop.
The example below, connects to a collection of streams by
setting the hyStreams object. A For loop is created that uses the
Count and Item properties of a collection in order to display a
property view that contains the stream name. The items in the
collection are indexed beginning with 0. The Count property
returns the actual number of objects in the collection so it is
Syntax: Typical Properties of a Collections Object
Item(index)
Accesses a particular member of the collection by
number.
Index(name)
Determines the index number for a member in
the collection by its name.
Count
Returns the number of objects in the collection.
Syntax: Enumeration of Objects
For Each element In group
[statements]
[Exit For]
[statements]
Next [element]