This interface allows you to determine the state of version control parameters.
The topics in this section include:
Allows you to determine whether the file is locked or not.
ECodeWarriorVCSFileLockState* type - the lock state.
'This script accepts as a commandline parameter the
`name of the project to be opened.
'The absolute path needs to be included. Ex:
'wscript thisscript.vbs "C:\testprojects\test1.mcp"
'If no command line argument is given, the script
`prompts the user for the
'absolute path of the project file to be opened.
'If specified the script tries to open the project,
`else opens the default one "c:\testprojects\test1.mcp'
'
'This script opens the project and selects the files
`(if on filelist pane or link order pane) that belong to the
'default target
option explicit
'*******Variable declaration
dim codewarrior
dim project
dim projectname
dim targetIntf
dim count
dim projectCollection
dim targetcollection
dim result
dim showinputbox
dim objArgs
dim projCount
dim projectfile
dim filelockedstate
dim vcsstate
dim i
dim filename
'****** Script ********
Set objArgs = Wscript.Arguments
projectname = "c:\testprojects\test1.mcp"
if objArgs.Count > 1 then
MsgBox "This Script expects only one argument, rest of the arguments will be ignored!!"
showinputbox = false
projectname = CStr(objArgs(0))
end if
if objArgs.Count = 0 then
showinputbox = true
else
showinputbox = false
projectname = CStr(objArgs(0))
end if
if showinputbox = true then
result = InputBox("Enter the absolute path for the project to be opened","Input", projectname, 100, 100)
If result = "" Then
projectname = "c:\testprojects\test1.mcp"
else
projectname = cstr(result)
end if
end if
'Create automation app object
set codewarrior = CreateObject("CodeWarrior.CodeWarriorApp")
MsgBox "App Created"
project = Null
'open project
set project = codewarrior.OpenProject(projectname, true, 2, 0 )
if TypeName( project ) <> "Null" then
set targetcollection = project.Targets
count = targetcollection.Count
IF ( count > 0 ) then
set targetIntf = targetcollection.Item( 0 )
set projectCollection = targetIntf.ProjectFileCollection
projCount = projectCollection.count
MsgBox CStr( projCount )
for i = 0 to projCount - 1
set projectfile = projectCollection.Item( i )
filename = projectfile.Name
set vcsstate = projectfile.VCSState
vcsstate.FileLockState( filelockedstate )
select case filelockedstate
case 0 MsgBox CStr( filename & ": VCS lock not checked" )
case 1 MsgBox CStr( filename & ": VCS volume locked" )
case 2 MsgBox CStr( filename & ": File is read only" )
case 3 MsgBox CStr( filename & ": file has read write attribute" )
case Else MsgBox CStr( filename & ": File lock state not defined" )
end select
projectfile = empty
vcsstate = empty
Next
END IF
else
MsgBox CStr( projectname & " does not exist" )
end if
ECodeWarriorVCSCKIDState* type - the CKID state.
ECodeWarriorVCSDBState* type - the DB state.