DownPicture

Sys(1269)

SYS(1269) returns information about an object's properties. It provides two pieces of information about each—whether it's been changed from the default and whether it's read-only. Broken in VFP 3.0, it has been superseded in later versions by the preferable PEMSTATUS().

Usage

lPropertyHasAttribute = SYS( 1269, oObject, cProperty,                               nAttribute )

Parameter

Value

Meaning

oObject

Object

The object whose properties are to be checked.

cProperty

Character

The name of the property to check.

nAttribute

0

Has the property changed from its default value?

1

Is the property read-only?


SYS(1269) was a very late addition to VFP 3; in fact, it was added to the product so late that it didn't get into the docs. It didn't work so well in that version, either, but by 3.0b was performing as advertised. However, by that point, the facilities it offered were so clearly needed that they got incorporated in a real, mnemonically (well, almost mnemonically) named function—PEMSTATUS(). So, in practice, there's never any reason to use SYS(1269), except in VFP 3.0, where it doesn't work right. (Specifically, in that version, passing 1 for nAttribute always returns .F., whether or not the property is read-only.)

When you pass 0 for nAttribute, SYS(1269) returns .T. only if the property has changed by being explicitly set. For example, if you add an object to a form, so ControlCount changes from 0 to 1, SYS(1269, oForm, "ControlCount", 0) returns .F., not .T. as we'd expect. It's possible, though, that it's meant to reflect only changes due to direct assignments. Similarly, SYS(1269) returns .F. when a property was changed in the class on which the object is based, but not in this instance of the object.


Example

oForm = CreateObject('Form') ? SYS(1269, oForm, "Left", 0)      && Returns .F. oForm.Left = 50 ? SYS(1269, oForm, "Left", 0)      && Returns .T. ? SYS(1269, oForm, "BaseClass", 1) && Returns .T.                                     && except in VFP 3.0

See Also

AMembers(), PEMStatus(), Sys()


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net