Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Defining Methods in Classes for Objects Added at Runtime
Message
From
24/02/2006 02:23:01
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01096949
Message ID:
01098787
Views:
17
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform