Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple Return Values
Message
De
06/12/2001 17:31:17
 
 
À
06/12/2001 17:23:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00590869
Message ID:
00590888
Vues:
39
>>>>Is it possible to have multiple return values coming from a form. If so how?
>>>
>>>Several strategies.
>>>
>>>1. Pass the calling form/object as a parameter and have the called form manipulate appropriate properties on the calling form.
>>>
>>>2. Instantiate the form with CREATEOBJECT syntax, have the calling program/form reference needed properties on the called form to assign values, then close the form.
>>>
>>>3. Set public variables (ugh).
>>>
>>>4. In VFP 7, you can return an array from a form/function, but there are some restrictions.
>>>
>>
>>Or (5) instance and return a parameter object, which can be as complex as you'd care to make it!
>
>Good catch! I did one once, but I guess I'd use that, as you say, in more complex situations, particularly where you want a persistent object to reference at different points.

Actually, I use parameter object a whole lot in order to simplify interfaces. A method takes a parameter object as input; you can now hold and pass as many complex values as you want in a single parameter, and carry it as a form parameter and have its values and behaviors persist along the life of an object like a form. A method returns a parameter object, which the caller can examine and query for content and more importantly it can carry behavior back to the caller!

I like parameter objects...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform