How to: View and Change Environment Settings

JavaScript Editor js editor     Web development 



Main Page

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 (Visual FoxPro).

Displaying Environment 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:

В Copy Code
? 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 Environment 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.

Setting the Environment Using the SET Command

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.

Note:
When 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:
To save a configuration made with SET commands, display the Options dialog box and save your settings there.

To set the environment programmatically

  • Use the SET commands that you want.

For example, the following lines of code set a default path, add a clock to the status bar and use a year-month-date (yy.mm.dd) format for dates:

В Copy Code
SET DEFAULT TO HOME()+"\VFP"
SET CLOCK ON
SET DATE TO ANSI      

For more information, see SET Command Overview.

See Also



JavaScript Editor js editor     Web development