Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Custom Class Problem
Message
De
19/11/1999 15:36:29
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00293267
Message ID:
00293283
Vues:
21
>I create a class that handles the customer address information.
>Contact name, address, apt, city, state, and zipcode so I can put it in the form that I wanted.
>The situation that I’m experienced is that how can I do to run the methods that I create in that class without affecting the place where I put it on the form?
>
>Ex. I have a FormSet1.Form1
>
>If I put my class in that form, inside my reset code I must write the code to reset all the fields depending on formset1.form1
>
>If I put my class inside formset1.form1.pgfgeneral.page1 I need to do the same thing but with that path.
>
>I want to be able to call the method of a class placing the class in both places without modifying the code.
>
>Thanks,
>
>FPATER

Check out the .PARENT operator.

For example, if you want to validate a ZIP code, you could create a custom method in your container class e.g. MyZIPCodeValidator(), then call it from the ZIP code .Validate method:

RETURN THIS.PARENT.MyZIPCodeValidator(THIS.Value)

There are lots of ways to do this, hopefully this gives you the idea.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform