Article ID: 193939
Article Last Modified on 3/10/2005
curProj = _VFP.ActiveProject
IF EMPTY(curProj.SCCProvider)
MESSAGEBOX("Project is not under SourceCode Control"+;
chr(13)+space(18)+"Unable to proceed")
ELSE
MESSAGEBOX("Project is under SourceCode Control")
ENDIF
RETURN
No. Source Control Status -------------------------------------------------------------------- 0 File is not Source Controlled (SCCFILE_NOTCONTROLLED) 1 File is Source Controlled and Checked In (SCCFILE_NOTCHECKEDOUT) 2 File Checked Out to Current User (SCCFILE_CHECKEDOUTCU) 3 File Checked Out to Other than Current User (SCCFILE_CHECKEDOUTOU) 4 File has Merge Conflict (SCCFILE_MERGECONFLICT) 5 File Merged without conflict (SCCFILE_MERGE) 6 File Checked Out to Multiple Users (SCCFILE_CHECKEDOUTMU)You can use the status property to make sure that a source control operation can or should be performed on a specific file. To check the contents of the property for a file, you can use the following sample code:
FUNCTION gSCCStat
PARAMETERS fName
CurProj = _VFP.ActiveProject
FOR i = 1 to CurProj.Files.Count
IF UPPER(fname) $ UPPER(CurProj.Files(i).Name)
IF CurProj.Files(i).SCCStatus = 0
MESSAGEBOX("File "+fname+" Is not Source Controlled")
fSCCStatus=0
ELSE
fSCCStatus = CurProj.Files(i).SCCStatus
ENDIF
ENDIF
ENDFOR
RETURN fSCCStatus
Function: Description
---------------------------------------------------------
AddToSCC: Adds file(s) to Source Control
Example: _VFP.ActiveProject.Files(1).AddToSCC
RemoveFromSCC: Removes file(s) from Source Control
Example: _VFP.ActiveProject.Files(1).RemoveFromSCC
CheckIn: Allows CheckIn of file(s)
Example: _VFP.ActiveProject.Files(1).CheckIn
CheckOut: Allows CheckOut of file(s)
Example: _VFP.ActiveProject.Files(1).CheckOut
UndoCheckOut: Allows Undo CheckOut for file(s)
Example: _VFP.ActiveProject.Files(1).UndoCheckOut
GetLatestVersion: Gets the Latest version of file(s)
Example: _VFP.ActiveProject.Files(1).GetLatestVersion
In the examples above, the file represented by FILES(1) is selected in the
source control dialog file list if the function can be performed on the
file. Otherwise, the very first file in the list will be selected. In the
dialog box, you can select to perform the function on one or multiple
files.
Keywords: kbhowto KB193939