Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Procedure and Form's phylosophies!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00314465
Message ID:
00314855
Vues:
29
Ricardo,
If your validations are ONLY used on one form, then do a form method for each, and call it in the Valid() code: Thisform.ValAddress(this.value). Here you'd have a form method ValAddress() which takes as a parameter the value of the textbox calling it.

If you will be using the same (or very similar) validations on several forms, then put this code in a class and drop the class onto the form. (Just drag it from the project.) Then you'd call it with Thisform.MyClass.ValAddress(this.value).

Be VERY careful about using form methods instead of classes. I've found that a form method must often be re-written as a class be cause I need it in a second (or third) place in the application.

Procedure files are useful for functions that are called in many places, but as you have found they cannot be used for a single form only - they apply to all open forms. Classes (or call them "business objects" are much better way to go. You'll also find that your validations begin to fall into categories and you may be able to combine some of them.

HTH
Barbara


>Dear friends,
>
>I am building now an application which has a lot of controls and VALIDATIONS on each form. As this became difficult to manage all forms with the same philosophy, i've decided to create a PRG for each form, where i do SET PROCEDURE TO... (ecah program has the routines needed for THAT form).
>Everything is OK. I open one form, automatically open the PRG, and uses the procedures. When i release the form, automatically close the procedure file.
>The problem i have is: when i'm on form (like invoices, for example), and the user goes to the menu and click to see the products form, i get trouble, because those PRGs have procedure's names in common (like NEW).
>Is there anyway that i can define my procedures to become active only to that form? (i have already thought on creating methods, but i think it will become confuse).
>
>Thanks, because i'm lost! :)
>I don't mind changing now, because i'm at the beginning.
>
>Cheers,
>
>Ricardo
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform