Microsoft KB Archive/163552

= How To Reduce the Size of Exe Files Built with VFP =

Article ID: 163552

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q163552



SUMMARY
Visual FoxPro executables include copies of the .scx and .vcx files that define the forms and classes of the project from which the .exe is built.

By default, the embedded copies include the source code of the methods and procedures as a debugging convenience. The source code can be quite large.

The developer can eliminate the source code in the forms and class tables by opening the project and deselecting Debug Info in the Project Information dialog box.

This feature of Visual FoxPro for Windows release 5.0 and 6.0 simplifies the similar functionality provided by the Buildapp.prg program that came with Visual FoxPro 3.0b.



MORE INFORMATION
To confirm the effect of using this feature follow the procedure below:

  In the command window, type the following command: CREATE PROJECT atest  Click the Documents tab of the Project. Create a new form.  Place several command buttons on the form, and in the click method of each type a command such as: =MESSAGEBOX("This is a very, very, very, very, very long message")  Close and save the method code windows and the form. Click the Programs tab of the Project. Create a new program.  In the edit window for that program, type the following comment: *Main program  Close and save the file as Main.prg (the "Main" program).</li> On the Project menu, click Set Main.</li> In the Project window, click Build. Click Build Executable and click OK.</li> In Windows 95 Explorer or Windows NT Explorer, locate and highlight the Atest.exe file. On the File menu, click Properties. Note the exact file size in the Properties dialog box.</li> In Visual FoxPro, click Project Info on the Project menu.</li> In the Project Information dialog box, click the Project tab. Deselect Debug Info, and then click OK.</li> Build the executable again, and replace the original Atest.exe with the new one.</li> In Windows 95 Explorer or Windows NT Explorer, locate and highlight the Atest.exe file. On the File menu, click Properties. Note the exact file size in the Properties dialog box. The exact number of bytes will be less than the number from the first build.</li></ol>

<div class="references_section">