Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

Sys(2030)

This function, added in VFP 7, determines whether the Debugger features can see various system components that are written in VFP. It makes it easier to debug your own code, while still offering the possibility of debugging system components or your home-grown replacements for them.

Usage

cDebugStatus = SYS( 2030 [, nDebugComponents ] )

Parameter

Value

Meaning

nDebugComponents

0

Set the Debugger to ignore system components.

1

Set the Debugger to see system components.

cDebugStatus

"0"

The Debugger doesn't see system components.

"1"

The Debugger sees system components.

A number of the tools that come with Visual FoxPro are, in fact, written in Visual FoxPro. That includes the Class Browser, the Object Browser, the Coverage Profiler and a bunch of others. If you don’t like the way they work, you have the option of modifying the provided versions (starting in VFP 6, all the source code comes with the product—earlier versions included some of it) or writing your own. A group of system variables with names like _Browser, _ObjectBrowser, and so forth, let you tell VFP what application to run when the specified tool is chosen.

So what? When you use one of these tools, the Debugger sees VFP code and behaves accordingly. For example, if you’re stepping through a program that runs the Class Browser, you step right into the Class Browser code. (That’s not as useful as it sounds, since you get “Source not available” in the Trace window, in this case.) Sometimes, that may be what you want, but more often than not, you’d like to skip over the tool code and just trace your own code.

But why not just do that by default? Because you can replace these programs, and when you do, you’re likely to want to be able to debug your replacements. So, you get control over this setting.

Okay, so what’s affected by the setting? The applications specified by _Beautify, _Browser, _Builder, _CodeSense, _Converter, _Coverage, _Gallery, _GenGraph, _GenHTML, _GenMenu, _GenXTab, _ObjectBrowser, _SCCText, _TaskList and _Wizard.

Which debugging features are involved? Stepping through code, coverage logging and breakpoints. Interestingly, event tracking is not affected by this setting.

Help says that setting SYS(2030) from the Command Window is meaningless. Our tests showed that that's as good a way as any (maybe even better) to set this one.

Example

nOld2030 = VAL(SYS(2030))
* Turn off debugging of components
SYS(2030,0)
DO (_Browser)
* Restore old setting
SYS(2030, nOld2030)

See Also

_Beautify, _Browser, _Builder, _CodeSense, _Converter, _Coverage, Debug, _Gallery, _GenGraph, _GenHTML, _GenMenu, _GenXTab, _ObjectBrowser, _SCCText, Set Coverage, Set Step, _TaskList, _Wizard