Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning a value from a class form
Message
De
12/11/2001 15:45:59
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00579966
Message ID:
00580605
Vues:
35
>I don't see the relationship between the level of abstractness and whether you would use private variables as opposed to parameters.

Like I said, its a rare situation, like in creating third party tools. You can provide a place to write custom code, plus pass information to that custom code without requireing a parameter list. Thats all cool, in the respect that you can change the number of avilable parameters, and none of the custom code breaks (you won't get the "not enough parameters" error when youdon't update your code). Its a technique I got from a Stonefield product, and, its a rare scenario, but its a good use of private variables, IMO.

>Two, presuming the validity of the premise, I don't see how it supports your viewpoint that a private variable should not be used to return a value from a form.

You're right. And niether did the global object example. But they weren't intending to prove you wrong. I simply stated, like you, that private variables aren't useless. I just think they're useless in the way that you used them, and gave examples of where I would use them.

>Using your logic, if I have a "really" abstract form class that accepts user input and returns a value, shouldn't I eschew parameters in favor of private variables???

No, you would create a method in the calling form that calls the class and returns a value from the class in a more traditional (dare I say cleaner? *g*) way. That means that the abstraction is in the calling routine now.

>What if you had a returnvalue property on your global application object? What if your single-value form class directly referenced this item? Is it wrong?

What do you mean by wrong?
If you mean, will it work, yes. That is right.
If you mean, do I think its the best way to do it, or even, an acceptable way of doing it? No.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform