Sys(3056)

SYS(3056) allows you to make temporary changes to your Visual FoxPro configuration, and then issue this function to restore the values you've established in the Registry and Config.FPWfiles.

Usage

SYS( 3056 [, nSkipSets ] )

Parameter

Value

Meaning

nSkipSets

1

Restore the current environment to those settings stored in the Registry, but do not modify the SET commands and do not read the Config,FPW file.

0 or Omitted

Restore all settings in the current VFP environment by reading them first from the Registry, including SET commands, and then reading the current Config.FPW file.


The Options dialog of the Tools menu puts a fascinating assortment of information into the Registry: many SET settings (including those that used to be available from the View window), default file locations, IntelliDrop field mappings, ActiveX controls, Syntax Coloring and all sorts of neat other options. SYS(3056) is the programmatic way to get VFP to read all of these settings we've stored. We see this being handy in two situations. First, it allows us to restore all settings to their "Saved as Default" values when we are messing around. Second, it allows us to twiddle the Registry to set those settings like Syntax Coloring, source code control, or IntelliDrop settings that don't have a matching VFP SET command, and then issue SYS(3056) to force VFP to read the changes we've made.These options are stored to HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\7.0\Options. You can use the native tools of your platform—RegEdit and RegEdt32—or a number of third-party tools to edit these settings, but do so with caution. Backups of the Registry should be a routine and regular task in your shop, and consider copying the set of keys you're working on to a REG file before messing with them.Note that options listed in the Registry in all uppercase (like NOTIFY) correspond to SET commands, whereas the mixed-case options (like EditorCommentColor) do not have a matching SET command.

SYS(3056) affects only those settings stored in the Registry key above, and not the subfolders of that key. That means that there are problems with IntelliDrop (field-mapping) classes, Visual FoxPro classes (those shown on the Form and Class Control toolbars), and ActiveX controls. There are actually two different problems here: IntelliDrop settings are immediately written to the Registry when you use the Options dialog, even if you don't press the Set As Default button, so issuing SYS(3056) just reads them back. This can still be an advantage to you: If you set the settings in the Registry programmatically, SYS(3056) will read them for you. But you can't experiment with these settings and then just issue SYS(3056) to restore to the previous settings. Once they're chosen, you need to remember the original settings to restore them.

The second problem is that the ActiveX and Visual Class Libraries available on the Controls tab of the Options dialog are never re-read. All of the other options displayed in the Options dialog do get re-read from the Registry by this function.


Example

SYS(3056,1)  && restore file locations, but not SETs

See Also

Configuration Files, Registration Database, Set, Set Resource, Sys(2019)


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .