Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
>back again. i think this might be a quick one but who knows.
>
>in one form ("form1") i issue a command "do form form2 to oretval_email"
>
>in form2, i have a command button that creates an "empty" object named oretval_email and i add properties to it. in the form's unload event, i have :
>
>lparameters oretval_email
>return (oretval_email)
>
>i was having some problems with this so i checked online and found that i also have to make sure that the destroy event of the command button has to have the variable/object available. therefore, i added the following lines to the command button's destroy event.
>
>lparameters oretval_email
>return (oretval_email)
>
>now, for the command button's click event, i added the following at the bottom to make sure the object was available to the other events:
>
>this.Destroy(oretval_email)
>thisform.Unload(oretval_email)
>
>my problem is that the object is available even at the point where the unload event occurs, but, for some reason, the unload event statement "return(oretval_email)" seems to run twice, and the second time makes the object ".f.".
>
>does anyone have any ideas how to correct this?
>
As an alternative to Jim's solution, add a property to the called form to hold the return value. Then, you don't have to worry about variable scope. In your button click:
This.oRetVal_Email = whatever
In Form.Destroy:
RETURN This.oRetVal_Email
Tamar
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement