JavaScript Editor js editor     Web development 

Main Page

Though Visual FoxPro is always fast, you can optimize the startup and operating speed. This section describes enhancing Visual FoxPro performance by managing startup speed and optimizing SET commands.

Managing Startup Speed

The time required to load and start Visual FoxPro relates to the physical size of Visual FoxPro, the length of the PATH statement in effect, the number of items to be found at startup, and other factors. You can control the load size, the search path, component file locations, and the startup SET command values of Visual FoxPro.

Managing File Locations

Visual FoxPro stores the FoxUser.dbf file, which contains user settings, in the user's Application Data directory by default. You can display this location by typing ?В HOME(7) in the Command window. Visual FoxPro searches for the FoxUser.dbf and Config.fpw files in the following places:

  • In the startup application or executable file, if any.

    For example, you can start a Visual FoxPro application by typing the following code on the command line:

    В Copy Code
     – or –

    В Copy Code
    VFPversionNumber.exe MyApp.exe
    If the startup application or executable file contains a Config.fpw file, the configuration file is always used. You can override settings in a Config.fpw file that are bound inside an application by specifying an external Config.fpw file, using the -C command-line switch when starting an application or Visual FoxPro.

  • In the working directory.

  • Along the path established with the PATH environment variable.

  • In the directory containing Visual FoxPro.

Controlling File Loading

You can also speed startup by preventing Visual FoxPro from loading files you don't plan to use. If your application does not use the FoxUser or FoxHelp file, disable them in the Config.fpw file by using the following commands:

В Copy Code

Visual FoxPro seeks all other Visual FoxPro components (GENXTAB, CONVERT, and so on) only in the Visual FoxPro directory. If you place components elsewhere, you must explicitly identify the path to those components in your Config.fpw file. For example, you might specify these locations:

В Copy Code
_TRANSPORT = c:\migrate\transport.prg
_GENXTAB = c:\crosstab\genxtab.prg
_FOXREF = c:\coderefs\

You can use the environment variable FOXPROWCFG to explicitly specify the location of Config.fpw. For details about the FOXPROWCFG variable, see Customizing the Visual FoxPro Environment.

Optimizing the Load Size of Visual FoxPro

If you don't plan on using any of the Visual FoxPro components listed previously, set them to an empty string to speed startup.

To optimize the load size of Visual FoxPro, use the following syntax:

В Copy Code
          = ""

Replace cFileVariable with _TRANSPORT, _CONVERT, or other variables as appropriate.

Optimizing Key SET Commands

You can optimize the operation of Visual FoxPro by tuning the values of certain SET commands.

The following table shows SET commands that have the greatest effect on performance, and their settings for maximum performance. You can specify SET command values by including them in the Config.fpw file, by typing them in the Command window, or by setting them in the Options dialog box.

Command Settings for Maximum Performance

SET Command Performance Setting









SET TALK Command


SET VIEW Command


See Also

JavaScript Editor js editor     Web development