Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.
This project method corresponds to the Clean Up Project option on the Project menu, but goes it one better. It packs the project table and, optionally, removes compiled code to force it to be recompiled.
prjProject.CleanUp( [ lDeleteObjectCode ] )
Parameter |
Value |
Meaning |
lDeleteObjectCode |
.F. or omitted |
Leave the compiled code in the project alone. |
.T. |
Remove the compiled code from the Object memo field. |
Over time, as you work on a project, lots of debris accumulates in the project file, including records marked as deleted because components were removed and memo fields bloating as code is recompiled and so forth. CleanUp throws away all that debris, leaving you with a nice, clean, smaller project file. This effect is the same as if you were to use the PJX file as a table and issue the command PACK.
However, the method has capabilities beyond what you can do with a mere PACK. The optional parameter lets you decide whether to clean out the Object field of the project as well. The Object field contains compiled code for programs, menus and queries. If you throw it out, the source gets recompiled the next time you build the project.
_VFP.ActiveProject.CleanUp()