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

This function, also a late addition to VFP 3, tells you the name of the form in which an instantiated object is stored.

Usage

uFileName = SYS( 1271, oObject )

Property

Value

Purpose

oObject

Object

The object for which you want to know the file name.

uFileName

Character

The complete path and file name for the form containing oObject.

.F.

oObject doesn't come from a form stored in an SCX file.

We can’t quite see why they added this function to the language. If you could hand it any object and find out where it comes from, it would be useful, but it only handles forms created as SCX files and the objects those forms contain. On the other hand, we can’t see any other way of getting to this information, so maybe there are some cases where it’s useful. For example, Doug uses it when working with multiple instances of the same form. His code renames each instance to have a unique Name, so SYS(1271) lets him figure out that they’re all the same form.

Like SYS(1270), this one returns values of two different types for no reason we can see.

According to Christof Wollenhaupt, a "there is not enough memory to complete this operation" error (error 43) occurs if SYS(1271) is used in any code called from the BeforeOpenTables or Load events.

Example

DO FORM Test
? SYS(1271, _SCREEN.ActiveForm)

See Also

Do Form, PEMStatus(), Sys(1270)