So, an object would just be considered a property? It is a timer control on the form.
>If you want to check the existance of a property use:
>
>
>IF PEMSTATUS(thisform,"tmrCheckMousePosition",5)
>
>ELSE
>
>ENDIF
>
>
>If you want to check for the existance of variable:
>
>
>IF VARTYPE(lcMyVariable) != "U"
>
>ELSE
>
>ENDIF
>
>
>Always works!
>
>>Those two expressions are completly different, and both will crash.
>>The first will crash if there is no THISFORM.tmrCheckMousePosition property, otherwise it will return .T. or .F. depending on whether >THISFORM.tmrCheckMousePosition is an object or not.
>>Tthe second one returns a character string describing whether THISFORM.tmrCheckMousePosition.O is a property, Method, Event or Object, >and thus will crash. Additionally, even if you change the second one to check the return type it will still crash if the tmrCheckMousePosition >object does not exist. I assume that you intended the second expression to be
>>PEMSTATUS(ThisForm, "tmrCheckMousePosition", 3) == "Object"
>>
>>Personally I prefer to use something like -
>>Type("THISFORM.tmrCheckMousePosition.Name") == "C"
>>This will never crash and also handles the case where THISFORM.tmrCheckMousePosition could be a .NULL. value of type object.
>>
>>Ian Simcock.
>>
>>
>>
>>The PemStatus line is wrong as what you have there will return a character string specifying i
>>
>>>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)
>>>