Partilhar via


Viewing and Changing Environment Settings

To view and change environment settings, you can use the Options dialog box.

To display the Options dialog box

  • From the Tools menu, choose Options.

The Options dialog box has a series of tabs representing different categories of environment options as shown in the following table. For details about options you can set using each tab, see the Options Dialog Box.

Tabs available in the Options dialog box

Use this tab To access these features
View User interface options, such as whether to display a status bar, clock, command results, or system messages.
General Data entry and programming options, such as setting the warning sound, whether to log compilation errors, whether to automatically fill new records, what navigation keys to use, what color palette to use, and whether to warn before overwriting files.
Data Table options, such as whether to use Rushmore optimization, whether to enforce uniqueness using indexes, the memo block size, the record counter interval for searches, and what locking options to use.
Remote Data Remote data access options, such as connection timeout values, the number of records to fetch at once, and how to use SQL for updates.
File Locations Locations for the default Visual FoxPro directory, where Help is stored, and where auxiliary files are stored.
Forms Form Designer options, such as the grid spacing, the scale units to use, the maximum design area, and what template classes to use.
Projects Project Manager options, such as whether to prompt for wizards, whether to run or modify files when double-clicking, and options for source control.
Controls Options for what visual class libraries and ActiveX controls to make available from the View Classes button on the Form Controls toolbar.
Regional Formats for dates, times, currency, and numbers.
Debug Debugger display and trace options, such as what font and color to use.
Editor Editor options, including margins, comments character, dropdown list length settings.

Font and color options for identifying elements of programs, such as comments and keywords.

Field Mapping Options for what controls to create when dragging tables or fields to a form from the Data Environment Designer, Database Designer, or Project Manager.
IDE Appearance, behavior, file extension, and save options for Visual FoxPro windows.

Displaying Configuration Settings

When Visual FoxPro is running, you can verify environment settings by using the Options dialog box or the DISPLAY STATUS Command, or by displaying the values of individual SET Commands.

To display multiple environment settings

  • From the Tools menu, choose Options to display the Options dialog box and view the current settings.

     – or – 

  • Type DISPLAY STATUS in the Command window.

To display individual environment settings

  • Use the SET( ) Function in the Command window to display the current value of any SET Command.

    For example, to view the current status of SET TALK, type:

    ? SET("TALK")
    

    **Note   **Because settings are valid only for the current data session, you must capture your settings and place them in a program or a form's Init event code for every private data session.

To echo Options dialog box settings to the Command window

  1. In the Options dialog box, make setting choices.

  2. Hold down the SHIFT key and choose OK.

    The settings are echoed to the Command window.

  3. Copy the setting commands from the Command window.

Saving Configuration Settings

You can save the settings you make in the Options dialog box for the current data session or as default (permanent) settings for your copy of Visual FoxPro.

To save settings for the current session only

  1. In the Options dialog box, make setting choices.
  2. Choose OK.

When you save settings for the current session only, they remain in effect until you quit Visual FoxPro (or until you change them again). To save changes permanently, save them as default settings; this stores them in the Windows registry.

To save current settings as default settings

  1. In the Options dialog box, make setting changes.

  2. Choose Set As Default.

    **Note   **The Set as Default button is disabled until you make a change to the current settings.

You can override default settings by issuing SET commands or by specifying a configuration file when you start Visual FoxPro. For details, see Setting Configuration Options at Startup.

The SET Command and Visual FoxPro Configuration

Most options displayed on the tabs in the Options dialog box can also be modified programmatically by using a SET command or by assigning a value to a system variable. For example, to use a year-month-date format for dates, you can change the Date Format setting in the Regional tab of the Options dialog box, or you can use the SET DATE command:

SET DATE TO ANSI      && Sets format to yy.mm.dd

If you configure the environment using SET commands, the settings are in effect only for the current session of Visual FoxPro. When you quit the program, your settings are discarded, and you must reissue the SET commands. However, you can automate this process by issuing SET commands at startup or using a configuration file. For details, see Setting Configuration Options at Startup.

Tip   You can also save a configuration made with SET commands by displaying the Options dialog box and saving your settings there.

See Also

Customizing the Visual FoxPro Environment | Options Dialog Box | Setting Configuration Options at Startup | Get Application Information from the Windows Registry | Changing Configuration Settings in the Windows Registry | Using SET Commands | DISPLAY STATUS Command