Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VARTYPE() vs PEMSTATUS()
Message
From
09/01/2009 08:15:06
 
 
To
09/01/2009 08:06:56
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01372210
Message ID:
01372313
Views:
18
>>>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)				&& This work !!!!
>>? VARTYPE(x.property) 			&& Expected : "U" too ; Error ! this is a BUG
>>
>>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) 			&& Expected : "U" too ; Error ! this is a BUG
>
As Fabio wrote, it's a bug, Vartype() errors on not existing properrties. Try
?Type('_vfp.alias') && 'U'
?Vartype(_vfp.alias) && Error
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform