Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: Parent property and PEMSTATUS
Message
De
14/08/2005 08:16:07
 
 
À
14/08/2005 07:50:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01040740
Message ID:
01040767
Vues:
13
>>>Because Parent is not usable, expected a Hidden or Protected setting
>>>
>>>* Expected no errors
>>>=CREATEOBJECT("myForm1")
>>>
>>>DEFINE CLASS myForm1 AS Form
>>>	PROCEDURE Load
>>>		IF	PEMSTATUS(m.this,"Parent",5)	;	&& Expected .F.
>>>		AND NOT PEMSTATUS(m.this,"Parent",2)		&& Expected .T.
>>>			? GETPEM(m.this,"Parent")		&& Then : Error 1924
>>>		ENDIF
>>>		RETURN .F.
>>>		
>>>	PROCEDURE eRROR
>>>		LPARAMETERS nError, cMethod, nLine
>>>		? nError,MESSAGE()
>>>ENDDEFINE
>>>
>>>Same for ActiveForm,ActiveControl ....
>>________________________________________________
>>Fabio,
>>
>>What do you mean by 'parent is not usable' ??
>>
>>Why do you want 'parent' to be hidden ?
>>
>>
>>As I see it, Parent can have a value, it is just not defined in the context above and hence the error
>
>Of course, if Parent ( or ActiveForm,ActiveControl ) is a object then
>it must to be readable,
>and PEMSTATUS(m.this,"Parent",0) return .T.
>
>When Parent is not defined, then:
>- My first choice is Parent return a NULL object
>- or Parent is hidden and PEMSTATUS(m.this,"Parent",5)=.F.
>
>Now, the only way is that to produce an error,
> and to make to capture it from TYPE () that then returns "U"
>
>A really absurd slow complication.

I'm not in favour of changing the return of pemstatus(). The property is defined. It's only the value that is not at that point in time

A return of a null value would make more sense imo and I guess that the error is, ahem, by design
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform