Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding to a Class Method
Message
De
12/03/2003 09:06:03
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
12/03/2003 08:13:01
Julie Ball
Gardner Publications, Inc.
Cincinnati, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00764700
Message ID:
00764731
Vues:
23
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform