Using One Tree SourceSafe with FoxPro 2.5x

--Tips Collected from Experienced Users

SourceSafe by One Tree Software, the project oriented version control system, has been used to track assembly language source files, CAD drawings, and everything in between.  An increasing number of professional FoxPro programmers across the country are discovering that SourceSafe is an invaluable aid in writing, tracking, and maintaining FoxPro programs, coordinating teams of FoxPro programmers, and archiving old project versions.

Along the way, they have also discovered a number of "tricks of the trade," specific ways to optimize SourceSafe for maximum productivity in the FoxPro environment.  This paper enumerates a few of those tips, to prevent the continual reinventing of the wheel.

If you have more suggestions that might be useful to FoxPro/SourceSafe programmers, please contact One Tree Software to have your ideas added to this list.


The Care and Feeding of the FoxPro Metafile
By Don Gilman, ACSI

If you are using the FoxPro PowerTools, all your screens, menus, reports, queries and even projects are kept in paired data files called "Metafiles."  These Metafiles are actually FoxPro .DBF and .FPT files, but with different extensions (see Andrew Hargreave's SYSTEM.INI file below).

Unfortunately, FoxPro will not open a Metafile which is tagged with the DOS read-only flag.  This is unfortunate because SourceSafe uses the read-only flag to indicate a file that is not checked out for modification.  So if you "Get" a Metafile, and then attempt to open it in FoxPro, you will get all sorts of errors from the FoxPro Project Manager and the appropriate PowerTool.

If you are working on a one-man project, there is a simple way to avoid this problem: always keep everything checked out.  You can use the "Keep checked out" checkbox in the SourceSafe Update dialog box to make SourceSafe keep all files checked out to you at all times.  (You can even set the variable Keep_Checkedout in your SourceSafe SS.INI file to make this the default behavior.)  If everything is checked out, the files will always be writable!

But if you are working in a team, keeping files perpetually locked is not practical.  In that case, there are two guidelines that will enable you to avoid the trap of opening a read-only Metafile.

1. Become an "externist": move all your code to the main or procedure file, which you can view even when it is not checked out.

2. If you want to check out a screen, make sure to Checkout both the .SCT and .SCX files, so that SourceSafe marks them as writable.  In other words, think like Noah, and always grab the Metafiles in pairs!


A Few General Tips: Using SourceSafe with FoxPro
By Don Gilman, ACSI

1. The DOS version of SourceSafe offers some extra flexibility; but the Windows version is quicker to use with FoxPro for Windows, as it is only a mouse click away.

2. The *.FXP and *.?PR files are subject to change every time you edit a Metafile, and can be rebuilt by Fox as necessary, so they should generally not be stored in SourceSafe.

3. To mark the release of a project, don't label each individual file: label the entire project, which will allow you to easily retrieve the entire system later.


Project Organization with SourceSafe
By Andrew Hargreave, RDI

As painful as it seems, we break all of our screens, menus, reports, labels and common programs into subdirectories under the main project.  A sample tree structure would be:

SourceSafe Project    Working Directory
$/TestApp             D:\TESTAPP
$/TestApp/Screens     D:\TESTAPP\SCREENS
$/TestApp/Reports     D:\TESTAPP\REPORTS
$/TestApp/Labels      D:\TESTAPP\LABELS
$/TestApp/Common      D:\TESTAPP\COMMON

With this structure, we can recursively Get the top-level project ($/TestApp) to create or refresh the entire project every morning.


A Few Useful SYSTEM.INI Variables
By Andrew Hargreave, RDI

These two lines are in the SYSTEM.INI file in the SourceSafe directory at RDI Software, and are useful as templates for any FoxPro user.

Note that both of these variables are placed above the [Internal] header in the file!

;These extensions always correspond to binary files
Binary_Masks=*.SCX,*.SCT,*.FR?,*.MN?,*.PJ?,*.APP,*.EXE,*.PLB,*.DBF,*.?DX

;These are the files we generally use in SourceSafe (except the last 3)
Relevant_Masks=*.PRG,*.H,*.SCX,*.SCT,*.SCE,*.FRM,*.FRX,*.FRT,*.MNX,*.MNT,*.PLB, !*.DBF, !*.?DX, !*.FPT


Credits

Don Gilman is the president of Applied Computing Services, Inc.  Located in Bryan, Texas, ACSI has specialized since 1984 in database applications for government and industry.  Mr. Gilman can be reached on Compuserve at 72166,2446.

Andrew G. Hargreave III is a General Manager at RDI Software Technologies, Inc.  Located in Des Plaines, Ill, RDI is a custom PC software engineering firm specializing in very large applications written in C, C++, Visual C++, Visual Basic, and, of course, FoxPro.  Former President of the Chicago FoxPro Users/Developers Group, Mr. Hargreave has given numerous lectures on using version control with FoxPro.  Mr. Hargreave can be reached on Compuserve at 72520,3705.
