Extending product function with VBA > System Architect collections > OfCollection class > Item
  
Item
Each member of the collection has a specific index number within the collection derived when the collection is created. The item variable is an object based upon the index of the collection. Its index number or name, if known, can reference this object.
Parameters
Data type: Boolean
Read-only
Example
Dim oDef as Definition, coll as OfCollection, i as integer
Set coll = oDef.GetPropertyAsCollection("Operations")
Debug.Print coll.Name
For i = 1 to coll.Count
Debug.Print coll.Item(i).Name
Next i
Enumeration is also supported with the For Each object In CollectionObject ... Next keyword structure.
Example script to list contents
Dim oc As OfCollection
Dim def as Definition
Dim def2 as Definition
Dim bOldRO as Boolean

' Remember old setting
bOldRO = sa2001.Encyclopedia.OpenObjectsAsReadOnly

' obtain def by id for instance
sa2001.Encyclopedia.OpenObjectsAsReadOnly = True ' set desired mode of access
Set def = sa2001.Encyclopedia.GetDefinitionById(100)
sa2001.Encyclopedia.OpenObjectsAsReadOnly = bOldRO ' restore old setting
set oc = def.GetPropertyAsCollection("Attributes")
For Each def2 in oc
debug.print def2.Name
Next
See also
OfCollection class