Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get return value from Modal form as Class
Message
De
21/10/1999 11:47:32
 
 
À
21/10/1999 11:21:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00279346
Message ID:
00279386
Vues:
15
>In other words, I can't do this with the form saved as a class. It has to be a form. Is that correct?
>

That's my understanding. Without a statement that sits there and waits on the Unload event to fire to pick up the value and put it in a variable, you're SOL.

One thing you could do is to create an object to receive the value, and pass the object reference into the form saved as class in the Init. Save the object reference in a form property. Update a property of the object (or do an AddProperty(), or whatever) before the form as class terminates. When control is returned to the program that fired the model form, it can then check the content of the parameter object to see any return value. And it works in more than modal forms, too, and can pass back more than a simple value this way, too.

>>>I have a modal form defined as a class. The class returns a numeric value in the Unload event.
>>>
>>>In my calling method I have:
>>>
>>>oForm = createobject('MyModalForm')
>>>nRetVal = oForm.Show()
>>>
>>>When the modal form returns nRetVal is always a logical!
>>>
>>>What am I doing wrong?
>>
>>To return a value from a Modal form, you need to use the DO FORM formname TO varname syntax. Unless there's code in the Show method, you'll get the return from the Show method (that's what you just asked for!) which, if nothing is specified, will be a logical. The form doesn't terminate when the Show event completes...
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
Répondre
Fil
Voir

Click here to load this message in the networking platform