Partager via


Viewing and Changing Environment Settings

To view and change environment settings, use the Options dialog box. The Options dialog box contains a series of tabs representing different categories of environment options.

To display the Options dialog box

  • From the Tools menu, choose Options.

The Options dialog box appears and displays tabs from which you can choose desired settings. For details about options you can set using each tab, see the Options Dialog Box.

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 commands.

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.

For more information, see SET Command Overview.

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.

SET Commands and Visual FoxPro Configuration

You can programmatically modify most options displayed on the tabs in the Options dialog box using SET commands or by assigning a value to a system variable.

For example, to use a year-month-date (yy.mm.dd) format for dates, you can use the SET DATE command instead of changing the Date Format setting in the Regional tab of the Options dialog box:

SET DATE TO ANSI      

If you configure the environment using SET commands, the settings take 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

Visual FoxPro Environment Settings | Setting Configuration Options at Startup | Get Application Information from the Windows Registry | Changing Configuration Settings in the Windows Registry | DISPLAY STATUS Command