Example: Displaying information about all attribute types in a VOB

' Connect to the top-level ClearCase application object
Dim CC As New ClearCase.Application
Dim VOB as CCVOB

' Get a VOB from the top-level ClearCase application object
Set VOB = cc.VOB("\projects")

' Get the CCAttributeTypes collection from the VOB.  Loop over the
' collection, gathering information about each attribute type
Dim AtType as CCAttributeType
Dim Str as String
For Each AtType In VOB.AttributeTypes
     Str = Str & AtType.Name & ":" & vbCrLf & " Owner: " & AtType.Owner & _ 
     "; Group: " & AtType.Group

     Select Case AtType.Constraint
     Case ccConstraint_None
          ' No constraint; don't add any ouput lines for this case
     Case ccConstraint_PerElement
          Str = Str & vbCrLf & "  Constraint: one instance per element"
     Case ccConstraint_PerBranch
          Str = Str & vbCrLf & "  Constraint: one instance per branch"
     Case ccConstraint_PerVersion
          Str = Str & vbCrLf & "  Constraint: one instance per version"
     Case Else
          Str = Str & vbCrLf & "  Unknown constraint type"
     End Select

     Select Case AtType.ValueType
     Case vbLong
          Str = Str & vbCrLf & "  Value type: integer"
     Case vbDouble
          Str = Str & vbCrLf & "  Value type: real"
     Case vbDate
          Str = Str & vbCrLf & "  Value type: date-time"
     Case vbString
          Str = Str & vbCrLf & "  Value type: string"
     Case Else
          Str = Str & vbCrLf & "  Unknown value type"
     End Select

     On Error Resume Next
     Str = Str & vbCrLf & "      Default value: " & AtType.DefaultValue

     On Error Resume Next
     Str = Str & vbCrLf & "     Lower value: " & AtType.LowerValue

     On Error Resume Next
     Str = Str & vbCrLf & "     Upper value: " & AtType.UpperValue

     ' etc, etc: Add your favorite attribute type properties here
     Str = Str & vbCrLf
Next

' Print the result
MsgBox Str

Feedback