Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add Code to a method at runtime
Message
From
06/08/2004 16:08:14
 
 
To
06/08/2004 15:56:00
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00931413
Message ID:
00931421
Views:
18
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform