Example: Working with checked-out files

' Connect to the top-level Rational ClearCase application object
Dim CC As New ClearCase.Application
Dim Ver As CCVersion
Dim CheckedOutFile As CCCheckedOutFile

' Get a CCVersion object from the top-level application object
Set Ver = CC.Version("m:\carol_main\caroltest\testelem.c")

' Check out the file, specifying a comment but taking most of the
' defaults for other checkout arguments, and get a CCCheckedOutFile pointer
Set CheckedOutFile = Ver.CheckOut(ccReserved, "check out for example")

' Invoke ICCCheckedOutFile properties on the checked-out file object
If CheckedOutFile.IsReserved = True Then
     State = "reserved"
Else
     State = "unreserved"
End If
MsgBox "Checked out " & State & " by view " & CheckedOutFile.ByView

' Invoke ICCVersion properties on the checked-out file object
MsgBox "Checked out on branch " & CheckedOutFile.Branch & vbCrLf & _
     "Predecessor is " & CheckedOutFile.Predecessor.ExtendedPath

' Invoke ICCFile properties on the checked-out file object
MsgBox "Checked out file has path " & CheckedOutFile.Path & _
     " and extended path " & CheckedOutFile.ExtendedPath

' Invoke ICCVOBObject properties on the checked-out file object
MsgBox "Creation comment: " & CheckedOutFile.Comment

' Cancel the checkout, removing the contents of the checked-out file,
' and getting back a CCVersion object 
Set Ver = CheckedOutFile.UnCheckOut(ccRemove)
MsgBox Ver.ExtendedPath

Feedback