Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code in Destroy event not working
Message
De
03/10/2003 08:26:26
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00834381
Message ID:
00834724
Vues:
17
If the form's destroy method continues to process while the myprg is run, then yes, I think it is possible. You may also want to add a wait state in the form's destroy method to prevent it from continuing to process until the myprg returns a value. That should ensure the form still exists as an object while myprg runs.


>Hi Tracy. Thanks for your reply.
>I take on board your suggestion .
>I was concerned though how this can happen in the first place, as I am calling the code with the form. Is it possible for the form to be actually destroyed ?
>
>Regards,
>
>Gerard
>
>
>
>>You can add the below code the called program myprg to trap for it to prevent the error message when it happens:
>>
>>
>>
>>*MyPrg.Prg Called from form's destroy method
>>Parameters oForm
>>IF TYPE('oform')="O"
>>	wait window oForm.caption
>>ENDIF
>>RETURN
>>
>>*In Form's destroy method
>>DO myprog WITH THISFORM
>>DODEFAULT()
>>
>>
>>>I have the following code in Destroy event of a form:
>>>Do MyPrg with thisform
>>>
>>>In MyPrg:
>>>Parameters oForm
>>>wait window oForm.caption .......
>>>
>>>Most of the time this works but the ODD occasion, an error comes up saying oForm is not an object. I cannot repilcate this myself on testing but it has happened a few times out on site !!!!
>>>
>>>Is it possible for the Screen to be destroyed by the time the code is run ? or is there any other reason this would not work ?
>>>
>>>Regards,
>>>
>>>Gerard
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform