Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>FOR EACH oForm in _VFP.Forms
>> oForm.Release()
>>ENDFOR
>>
>
>oForm.name would tell you which form is causing the problem? Maybe put a WAIT WINDOW in your code to display the value.
>
Thanks Wayne, using that info, I tried to debug by watching the value of 'oform.name'. What happened was that its value changed, as expected, when it hit the Diary form (the one on which I'm getting this problem) and it proceeded to release the Diary form. As soon as it entered the form's unload method the value of 'oform.name' disappeared! Nevertheless, the unload method completed its task without incident and the form duly disappeared.
However, when the loop took it back to 'oForm.Release()', because the value of oform.name had vanished into the mist, we crashed with the 'unexpected failure'. If I 'ignore' its protest, it then finds the remaining forms, correctly assigns 'oform.name' and there is no further difficulty.
The kludge I have implemented to get around this peculiar behaviour is simply to test for the existence of the variable 'oform.name' ahead of the 'oForm Release() command. (If type('oform.name')<>'U' )
which resolves the problem, but the question left hanging in the air is, of course, why should I need to do that in the first place?
Thanks for the help
Harry
Précédent
Suivant
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