>>>>>>Is there any difference between these two functions - Dragan's anticipated comments aside - or advantage of one over the other?
>>>>>>
>>>>>>IF VARTYPE( THISFORM.tmrCheckMousePosition ) = 'O'
>>>>>>
>>>>>>
>>>>>>IF PEMSTATUS(THISFORM.tmrCheckMousePosition,'O',3)
>>>>>>
>>>>>
>>>>>Are equal for not protected or hidden properties, but :
>>>>>
>>>>>
>>>>>CLEAR
>>>>>X = CREATEOBJECT("XX")
>>>>>? PEMSTATUS(m.x,"property",5)
>>>>>? VARTYPE(x.undef)
>>>>>? VARTYPE(x.property)
>>>>>
>>>>>DEFINE CLASS xx as Custom
>>>>> PROTECTED property
>>>>>
>>>>> PROCEDURE Init
>>>>> ? PEMSTATUS(m.this,"property",5),VARTYPE(this.property)
>>>>>
>>>>>ENDDEFINE
>>>>>
>>>>
>>>>Why did it error on this line?
>>>>
>>>>? VARTYPE(x.property)
>>>>
>>>
>>>As Fabio wrote, it's a bug, Vartype() errors on not existing properrties. Try
>>>?Type('_vfp.alias') && 'U'
>>>?Vartype(_vfp.alias) && Error
>>
>>So, then PEMSTATUS() would be the way to go for objects. I guess there is no way for one thing to check for the existence of both vars and objects. I wonder if there is a way to cascade the VARTYPE and PEMSTATUS to achieve this? Without getting any errors?
>
>I did not read all the messages. But if you only need to check whether a variable, property or object really exists, type() will do the job fine.
Then why all the PEMSTATUS and VARTYPE stuff if TYPE is all you need?