Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Do I overide the class code
Message
From
07/01/2001 23:33:31
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00460393
Message ID:
00460397
Views:
15
Thanks Nick

I will investigate this. I also toyed with the idea of adding 2 custom properties "PREfunc" and "POSTfunc" the class with the default of "" (empty string)

Now to my timer.timer code, I could add the foll

IF NOT EMPTY(This.Parent.PREFunc)
MY CODE BEFORE
ENDIF

DODEFAULT()

IF NOT EMPTY(This.Parent.POSTfunc)
MY CODE AFTER
ENDIF


This should work as well I guess.

Bernard

>Hi Bernard,
>
>It is not possible to override the code in the class instance method with a custom code for this particular instance. But you can make a workaround. You may place a call to custom PRG in your class method (with the check if PRG exists). You can create the PRG with a custom code in the runtime, and compile it on the fly. (starting with VFP 6 Service Pack 3).
>
>>I have a container class that contains other objects including a timer. The class code in the timer.timer method runs every n seconds as set. This code gets a value which is then stored in a property of the class.
>>
>>To use this class called "olescale" I have in a form.init
>>
>>SET CLASSLIB TO myclass.vcx
>>ThisForm.ADDOBJECT("myclass","olescale")
>>
>>Various class properties are set and then the timer is enabled.
>>
>>What I need is a way to add my own code to the Timer.Timer code of the class after it is ADDed the same way I can change its properties, so that it will look and run as follows:
>>
>>* oleclass.Timer1.Timer()
>>
>>My code here
>>...
>>...
>>
>>
>>DODEFAULT() && run the class code
>>
>>Some More of my code here
>>...
>>...
>>
>>
>>I can instanstiate the object with ADDOBJECT but how do I get my code to be run in a method of this class?
>>
>>I do not want to place the code into the class itself, as this class can be used for other things.
>>
>>Is this possible?
>>
>>Thanks
>>
>>BErnard
Previous
Reply
Map
View

Click here to load this message in the networking platform