>>Is there a simple way to test if an object has a property or a method? I could use amembers then check the array, but I was wondering if there is a VFP command that alread does this.
>
>Evan,
>
>llHasProperty = PEMSTATUS("cObjectName","cPEMName",5) is the normal way of testing for a property/event/method.
>
>Beware the traps, though. For example PEMSTATUS("cLablename","TabStop",5) where cLabel is derived from the label class will return true -- even though a label does not have an exposed tabstop property.
>
>Generally, PEMSTATUS() will tell you whether the object has a property, but does not tell you if it is actually available to use. It may be hidden, protected or out of scope.
>
>regards,
James,
You might want to look at the other options of PEMSTATUS, in particular PEMSTATUS("cObjectName", "cPEMName", 2) will return .T. if the property is protected.
I haven't relied on this function that much as I have heard that it is somewhat buggy, GPF prone, but I can't remember where I heard it.
Hopefully, someone else will chime in if I am mistaken on this point.
HTH,
Ned Ames
Ned
Reality is.