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 seeks Foxuser.dbf and Config.fpw in the following places:

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

    For instance, you might start a Visual FoxPro application by using a command line such as the following:

    VFP MYAPP.APP
    

     – or –

    VFP MYAPP.EXE
    

    If the startup application or executable file contains a Config.fpw file, it is always used and cannot be overridden.

  2. In the working directory.

  3. In the directory containing Visual FoxPro.

  4. Along the path established with the PATH environment variable.

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
_CONVERT = c:\fp2vfp\convert.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

Optimizing Your System | Optimization of Visual FoxPro in a Multiuser Environment | Configuring the Operating Environment | Customizing the Visual FoxPro Environment | SET ESCAPE Command | SET REFRESH Command | SET SYSMENU Command | Command Window