Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning a value from a form in a class
Message
 
À
20/06/2000 12:38:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00380150
Message ID:
00382267
Vues:
24
Another thing - while testing you should care also that parameter objects is instanciated and accessible. So for the simple apps the parameter object may not worth instanciating. :)

>Also - passingin a parm object doesn't completely decouple anyway - both the form and calling method still must make some assumptions about the structure of the object. Pick your poison!
>
>Ken
>
>>I understand and agree with your observation, but disagree that it matters. While I am all in favor of blackboxing many things. decoupling is not the holy grail - at least not within a homogenous application. On the other hand, I doubt there's much code/performance cost (if any) in doing it with an object, so it's worth thinking about.
>>
>>Ken
>>
>>>Ken,
>>>
>>>Using form properties tightly couples the system to the UI. Using a parameter object makes it much more loosely coupled.
>>>
>>>>I just store any return value in a property of the modal form - i.e. "xRetVal"
>>>>then it is available to the calling method via that property. Example
>>>>
>>>>1) o = create("MyModalForm")
>>>>
>>>>2) in MyModalForm - some action sets the xRetVal property of MyModalForm
>>>>
>>>>3) the 'Done' button on MyModalForm does a thisform.hide()
>>>>
>>>>4) control is passed back to calling procedure where the return value is easily referenced by o.xRetVal
>>>>
>>>>This method also has the advantage of allowing you to access all the controls on the modal form. This is very useful in a multiple textbox "fill in the blank" type dialog. You can simply reference the filled in textboxes directly like o.txtName, o.txtPassword, etc.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform