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(1272)

This function gives you the complete containership hierarchy for any object. In other words, you hand it an object reference and it’ll tell you exactly how to address that object. It’s sort of the object version of FULLPATH().

Usage

cCompleteReference = SYS( 1272, oObject )

One of the difficulties in the OOP world is literally getting a handle on things. When you run a form, you may not know the name of the form. _SCREEN.ActiveForm is one solution to this problem, but SYS(1272) gives you more leeway because you can grab the exact reference needed. Try SYS(1272, _SCREEN.ActiveForm.ActiveControl) to see the exact hierarchy for the object with focus.

This function seems useful mostly for debugging and for developer tools, not in production code.

Example

* To see exactly where you are while debugging, try this
* in the Watch window:
SYS(1272, SYS(1270))
* As you move the mouse, you can see exactly which control
* you're over with its entire hierarchy.

If you use the example, remember to remove it from the Watch window before you try to close the form. The reference it creates keeps the form from closing.

See Also

ActiveControl, ActiveForm, Sys(1270)