Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding to a Class Method
Message
From
12/03/2003 09:06:03
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
12/03/2003 08:13:01
Julie Ball
Gardner Publications, Inc.
Cincinnati, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00764700
Message ID:
00764731
Views:
24
>I have a class that contains a command button. I have placed this class onto many of forms with much success. Well now I have a form that I will need to add additional code to a couple of the methods in my class. I would like for the code that already exists to run, but include the code that I need to add. How do I do this without coping the existing code to there corresponding methods and then add the new code?

DoDefault() is often enough to run the inherited method.

In some cases, you may also need to a) Pass parameters to the inherited methods, b) check return value of the inherited method.

Examples:

a)
* Some custom method - inherited method is called with This.MyMethod(a, b)
lparameters a, b
DoDefault(a, b)
b)
* Init()
local llReturnValue
llReturnValue = DoDefault()
* Additional commands go here
return llReturnValue
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform