Checking for Differences in Forms, Reports, and Other Table Files
In Visual FoxPro, only a few types of files are treated as text files by the source control software. These include program source code (.prg) files and the project file list (.pjm file). Forms, reports, and other types of files are actually stored as tables of information about their components. For example, a form's .scx file is a table of the controls in that form, plus information about the form itself. Table-type files are used to store information about forms (.scx files), reports (.frx files), menus (.mnx files), labels (.lbx files), and class libraries (.vcx files).
Because these files are stored as Visual FoxPro tables, source control systems cannot treat them as text files (the source control system treats them as "binary" files). As a result, tools for viewing differences between versions of these files cannot pinpoint the differences, nor can you see a history of changes.
In order to allow you to use source control to view differences in forms, reports, and similar files, Visual FoxPro creates text representations of them. Then, when you put one of these files under source control, Visual FoxPro creates a text version of the file, which it maintains automatically as you make changes.
Text representation of Visual FoxPro file
To support the capability to generate text representations of table-type files, Visual FoxPro includes the utility program Scctext.prg, or you can use a different program that you obtain from another source or write yourself.
To specify a text conversion utility
- In the Options dialog box, choose the Projects file.
- In the Text generation box, enter the name of the conversion program.
- Choose Set as Default, and then choose OK
Visual FoxPro automatically calls the text conversion program whenever you add a form, report, menu, label, or visual class file to a source-controlled project. The utility generates a text file that has the same name as the primary file, but uses "A" as the last letter of the extension. For example, for a form called Myform.scx, the utility generates a text file called Myform.sca. When you check in the form (or other file) after changing it, the source control software automatically creates and checks in the text file.
If you specify a text conversion utility when you already have forms, reports, and similar files in your source-controlled project, you must temporarily remove them from the project, and then re-add them with text generation enabled.
To generate text representations for existing files in a project
- Back up all the files that will be affected: forms, reports, menus, labels, and class libraries.
- Verify that the files aren't already checked out.
- From the Project menu, choose Source Control, and then choose Remove Files from Source Control.
- Select the files to remove from the project, and then choose OK.
- Enable text generation, following the steps described earlier.
- From the Project menu, choose Source Control, and then choose Add Files to Source Control.
- Select the files to add, and then choose OK.
As it puts the each file under source control, Visual FoxPro also creates the corresponding text representation for the file.
See Also
Comparing Files or Projects | Displaying File and Project Information | Developing in Teams | Management of Files in a Source-Controlled Project