Information générale
Catégorie:
Codage, syntaxe et commandes
David,
Thanks again for the help and insight. I like your methods and will assilimate
it at once into my collective...
Thanks a million
>>Thanks for the reply, I have read your message perhaps a dozen times and have given it much thought. At the time I didn't have much invested into the error routines. I like the idea of passing the error to the form cause if you have an error in runtime most likely you want to close the form...
>
>Sometimes it's better for the object to be fully responsible for handling the error, other times it's better for the form to do it.
>
>>In your objectbaseclass.error you call ObjError( this, nError, cMethod, nLine) is that part of your application class? Am I correct in thinking that if the subclassed object if it has no error routine it will call the baseclass.error as a default error handler. If you know that there might be a runtime error (file missing or corrupt) you code into your subclassed object the code to handle it. Am I correct so far?
>
>All of my lowest level classes cTextbox, cForm, cGrid, etc. have the one line of code to call ObjError() I set it up as a UDF so I don't have to test for the existence of a service provider like oApp or oErrorHandler. This minimizes duplicated code in each of the baseclasses. In ObjError() you could encapsulate the functionality of looking for oErrorHandler, instantiating it if it doesn't exist and handing the error off to it. For the kind of development I do logging the error and shutting down a runtime app or going into the debugger at devtime is all I've ever needed.
>
>>How does ObjError call debug? Do you suspend in your error method if you are in the dev environment if you call debug?
>
>I use glRuntime = ( version(2) = 0 )
to determine if it's runtime or devtime. If it's devtime I pop up lnResult = MessageBox( m.lcMessage1 + m.lcObject + "Suspend?", MB_YESNOCANCEL + MB_ICONSTOP, _screen.Caption )
if lnResult = IDYES the code just does an activate window trace
and suspend
from there it's just a couple of single steps to get back to the code that caused the error.
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