Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form that returns a value to a variable
Message
De
21/08/2000 15:36:53
 
 
À
21/08/2000 15:15:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00407476
Message ID:
00407484
Vues:
29
>I know that it is possible to return a value from a form to a variable use code such as:
>
>do form c:\myform.scx to nValue
>
>However, this requires that I save the form and call it explicitly. I'd like to be able to create an instantiation of a form already existing in one of my class libraries and have it return a value to a varaible. Is this possible? if so how??
>
>TIA

First, the called form must be modal.
Second, don't Release() it like usual, but Hide() it; then you can access the form's return value property, e.g.

** in the modal form, I assume you'll have an OK button (or similar)
** in the modalform.cmdOK.Click()
** set the custom property uRetval
thisform.uRetVal = "Hello world."
thisform.Hide() && this is the key to it.


** to call the modal form
loForm = CREATEOBJECT("mymodalformclass")
loForm.Show()
** this code continues after above form's Hide() is performed
luRetVal = loForm.uRetVal
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform