Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a value from a class form
Message
From
14/11/2001 13:22:52
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00579966
Message ID:
00581661
Views:
29
John:

> In addition to the other suggestions, I want to suggest something else that
> also works and often gets overlooked...
>
> A private variable...
>
> Don't laugh...< g >
>
> Some may say this is not OOP. Whether you instantiate an object that has to
> be passed to the form or whether you declare a private variable and have the
> form reference that variable, I don't see a material difference.
>
> Do I advocate the use of Private Variables for widespread use? No. I advocate
> the use in these limited circumstance.
>
> Private dRetVal
> *- Instantiate the class
> *- Populate the variable in the class
> *- Done...
>
> It's simple and it works...

Not a bad idea at all. The only problem is that all calling procedures must know the name to use for the private variable. I offer a little variation:

Local ldBirthdate
ldBirthDate = GetDate(ldBirthDate)
where GetDate is responsible for creating the private variable and instantiating the class. The class is still responsible for populating the variable.

Programmers no longer need to know the name of teh variable to instantiate.

Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform