>>>>>If you need to check for a property or a method, use pemstatus. Otherwise you may check with vartype. It all depends on what you're trying to do.
>>>>
>>>>Syntax aside, obviously I'm checking to see if an object exists. Just an exacto knife and a pencil, Nadya.
>>>
>>>In this case, I would try to use GETPEM() or check for type('myObject.myOtherObject.Name') = 'C'
>>
>>Did you mean 'O' instead of 'C' ? I'm checking for an object.
>
>No, I meant 'C' because I'm checking for a name of the object - property that exists for all objects. This is what I use and Ian too. It handles a case of object already destroyed (null).
All objects? Well, not all. There are two exceptions: empty object, and scatter name object. These may have a name property by accident, of course - addproperty(oEmpty, "Name", 42) would throw your test completely, and even a scatter name object may be scattered from a cursor which had a name field (which could be a logical or a date or whatever - there are weird table designs out there...).
But if we're looking for controls, as Jay is probably doing (judging by his other posts these weeks), then checking for type('myObject.myOtherObject.Name') = 'C' is a true and tried technique which tests for both existence and isnull() at once.