Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Handling in VFP 5.0a
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00080468
Message ID:
00112613
Vues:
33
>Hi,
> What was your code, and what did you end up doing?
> I put code in the error method of a command button and had it release the form. It worked.
>Thanks.
>>I want my error routine to simply close the active form, close all tables, revert all tables etc. This works fine except it will not release the active object if the error happened there. This denies me the ability to shut down the form and keep the .exe file running.
>>
>>My intention was to call the error routine, close all forms, save the initialization global variables to a .mem file, clear the memory, restore the .mem file, delete the file and reinitialize the environment.
>>
>>I tried putting a timer on the form and keeping it disabled. When the error handler is called, it activates the timer (which has code to shut down the form) then returns back to the form. The timer was to shut down the form. I tried for 3 hours to get this to work but to no avail. The error handler allways returns to the object that had focus when the error occurred. The timer never went off and all objects except the error one were removed from the form. (I placed code in the error routine NOT to release the timer).
>>
>>Does anyone know how to shut down a form and still keep the .exe running?
>>
>>Thanks in advance...
>>Robert

I had a generic on error do .... routine that I use everywhere. It checks for all objects on a given form and if type('objectName') returns 'O' then I attempt to destroy it. All is well except if the object that caused the problem, I had a container that called a drive a:, b: etc. caused the error, then the error calls the error routine, the object that caused the problem failed to unload.

I never did get it to work -- after many attempts. I didn't put error code in the container itself - this would be alot of work and I don't know, without checking, whether the on error in the object would get called before (or both) the on error routine. Do you know? Right now I simply save the error into a table, display it and exit the .exe file. Not what I wanted but it always works!

Robert
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform