Partager via


Optimizing Visual FoxPro Startup Speed

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:

                    VFPversionNumber.exe MyApp.app
    

     – or –

    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:

RESOURCE = OFF
HELP = OFF

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:

_TRANSPORT = c:\migrate\transport.prg
_GENXTAB = c:\crosstab\genxtab.prg
_FOXREF = c:\coderefs\foxref.app

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:

        cFileVariable = ""

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 ESCAPE Command

ON

SET OPTIMIZE Command

ON

SET REFRESH Command

0,0

SET SYSMENU Command

DEFAULT

SET TALK Command

OFF

SET VIEW Command

OFF

See Also

Concepts

Optimizing Visual FoxPro in a Multiuser Environment

Optimizing the Operating Environment

Reference

SET ESCAPE Command

SET REFRESH Command

SET SYSMENU Command

Command Window (Visual FoxPro)

Other Resources

Optimizing Your System

Customizing the Visual FoxPro Environment