Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add Code to a method at runtime
Message
De
06/08/2004 16:08:14
 
 
À
06/08/2004 15:56:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00931413
Message ID:
00931421
Vues:
19
>I have a idea. Build data forms dynamically based on cursor data, but how can validate the fields? My idea is add code to the objects, how again?

Your data validation should not be that tight with the user interface code. You'd be better off creating a business object that has all of the validation code in it. You can use standard names for each field, so the right methods can be called by your dynamic form. For example:
define class Customer as businessBase
&& of course you've got to create a businessBase class
&&     and put common functionality there

   function ZipCode_AllowSave
       * return .t. or .f.
   endproc

   function TermsCode_AllowSave
       * validation code
   endproc

enddefine
You can write a program (our use a code generator) to create code like the above, based on your data files.

There is a lot more that would have to be done to make this fully functional...

What do you think?
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform