Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handling in vcx
Message
From
02/08/2018 12:17:23
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
02/08/2018 11:39:27
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01661417
Message ID:
01661418
Views:
51
>Hi how are you, I need your help, I'm trying to capture the uncontrolled errors of my application, at the level of the captures forms and I send to close the screen without problems, but when it is at the class level (I have a main class) capture the errors but the form does not close
>
>lparameters nerror, cmethod, nline
>vmatxr=aerror(_matrixz)
>thisform.megaclase1.mensajes2('se ha producido un error inesperado en el sistema!!!'+;
   CHR(13)+'error.............:('+alltrim(_matrixz(2))+')'+chr(13)+'METODO............:'+;
   alltrim(cmethod)+CHR(13)+'linea con error...:'+alltrim(str(nline));
   +chr(13)+'esta pantalla se cerrará, favor notificar al departamento de sistema, gracias',1)
>thisform.release()
>return 0
>thisform.refresh()
>
(reformatted a bit to prevent cinemascope view)

I assume this is the form's .error() method. I think very few people are using it nowadays, as it seems to have some bugs. Just the other days a friend has complained about such behavior (after .error() was triggered, textmerge stopped emiting to file and a few other oddities). Try/catch is much more reliable.

The thisform.refresh() there is redundant - it's after a return statement so it would never execute.

Form will not release if there are unresolved object references to it (or to its members), by either outside objects or its member objects or object properties. Some of these references are removed automatically, but it's quite possible that they don't, so check for that. Also, if any of the updatable buffered aliases in the form contains uncommited changes (i.e. dirty buffers), either save each or tablerevert() them (which is better - an impossible value somewhere in the buffers may be causing the error and it wouldn't save anyway).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform