Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining Methods in Classes for Objects Added at Runtime
Message
De
24/02/2006 02:23:01
 
 
À
23/02/2006 19:31:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01096949
Message ID:
01098787
Vues:
16
>In your reply to me, you provided the following code fragment:
>
>>
>
>CLEAR
>
>x=CREATEOBJECT("someClass")
>? x.oInner && you can access to the protected object !
>x.show(1)
>
>DEFINE CLASS someClass AS Form
>
>	ADD OBJECT PROTECTED oInner AS TextBox
>
>	PROCEDURE init
>		* bind doens't work within the class !
>		BINDEVENT(this.oInner,"Click",m.thisform,"delegate")
>
>	PROCEDURE delegate
>		DEBUGOUT PROGRAM()
>
>	PROCEDURE error
>		lparameters a,b,c,d
>		? MESSAGE()
>ENDDEFINE
>
>>
>
>Fabio, I don't think this will work. I didn't copy and paste your code to test it, but I think you're looking at the genesis of my problem in the first place: BINDEVENT won't be able to see oInner since it's PROTECTED. BINDEVENT seems to require that all participants be public.
>

In fact.

>Now, the visibility issue (i.e. the exposure of oInner) is a separate issue, and that one concerns me. I'll spend a little time tonight exploring that one.
>
>Eric

My suggestion is that not to lose days and nights to try to build
a OOP model in VFP, doesn't have hope to succeed us,
the errors of programming and design are too many.

In VFP you have to use the tools that the environment makes you available,
without looking for an intrinsic coherence and with a formal correctness.

Fabio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform