Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: =?UTF-8?Q?E=C2=AE!k_\\/!$$E=C2=AE?= Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Vulcan build 208 Date: Thu, 6 Oct 2011 19:33:33 +0200 Lines: 110 Message-ID: <9f673eFddrU1@mid.individual.net> References: <3bel87p186igbgsmhgl7huklffdtt5keav@4ax.com> <9ujq87ledb9elr4rqk0okbjdbcvuk482g8@4ax.com> <9f5p04Fj00U1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 8bit X-Trace: individual.net kfeefo5XBwKbZFf/zxq+VQBpSLkz5d1vgQFnU57M+jhYYasJ95 Cancel-Lock: sha1:W9eCF8JGlPuOnknb+xyk2MUMe7Q= In-Reply-To: X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 Xref: x330-a1.tempe.blueboxinc.net comp.lang.clipper.visual-objects:2184 Willie, > Yes this would exit and log the error. The error handling that I do at > the method level is designed to catch and recover when I can. But if > something comes up that I had not anticipated, I will at least get a log > that I can see when the problem is located. Sure, and IMO that is a good strategy. But it does not help Dick, where he is able in VO to hook in his own errorhandler. I have taken my lesson from good 'old' Rod da Silva, i think it was on a conference at the end of the previous century, where he showed us a coding framework for code that could not crash. It was used for writing services, but very usefull for ordinairy apps as well. He gave us some very practical rules of thumb. - the number of rows of code in a method should not exceed the max. visible on a screen. If there are more rows, split up. - every method should have a begin-recover-end sequence inside ( something that can be implemented very easy using UDC's ) - every method should return a boolean, true if succeeded and false otherwise. - if you need another value, pass a parameter by reference. I have used this for many years and am very happy with this. But unlike me, writing several new (smaller) app's each year, Dick has a major large application, born in VO 1.0 and extended over the years. Not an easy task to rewirte it with new coding principles. Erik "E®!k \/!$$E®" wrote in message news:9f5p04Fj00U1@mid.individual.net... Willie, In this scenario, your app will always close after an error, or am I mistaken? Not very usefull IMO. Erik "Willie Moore" schreef in bericht news:j6k6qo$kir$1@speranza.aioe.org... Dick, I am not sure where you got the idea that you cant have a general error handler. I use the framework below in the start of all of my winforms app. I have a slightly different one for my WPF apps but both use the same error logging routine. Error handling is handled a bit differently from VO but in my opinion, it is a better system. In my methods, I use local handlers (try catch blocks) to catch and handle things that are specific to that method. If an exception happens, dotNet first looks for a local errorblock. If it does not find one it then looks at the next method up the call stack for a handler that can handle the exception. If it reaches the root of the application without finding a block then you get a error box that looks a lot like VO's. By adding the try block in my start function I can catch and log the errors. As far as the other points. I structure my apps so all of the projects in my solution output to the same directory. I rarely touch my base libraries so I don’t compile them unless I make a change. I do the same with my GUI. I separate all of my GUI forms into their own assembly. In my exe I subclass each form and add my event handlers to the subclass just like I did in VO. One of the nice things about Visual Studio is that you can have different settings for different config tasks (ie debug, staging, release, etc). In debug I don’t recompile everything but in release I do so all of the DLLs go out with the same datetime stamp. Regards, Willie GLOBAL goSysInfo As SysInfo /// /// The main entry point for the application. /// [STAThread] ; FUNCTION Start() AS VOID LOCAL oShell AS ShellWindow LOCAL lRunApp AS Logic TRY SetupRightSLE() Application.EnableVisualStyles() Application.SetCompatibleTextRenderingDefault( false ) oShell := ShellWindow{} lRunApp := oShell:Start() IF lRunApp Application.Run( oShell ) ENDIF CATCH ex as System.Exception LOCAL oLog as ErrorLog oLog := Errorlog{} oLog:DumpException(ex) MessageBox.Show(ex:ToString()) END TRY RETURN FUNCTION SetupRightSLE() AS VOID rightSLE.DefaultSelectionOnFocus := focusBehavior.All RightSLE.DefaultProcessEnter := KeyHandling.Process RightSLE.DefaultProcessArrow := KeyHandling.Process RightSLE.DefaultOverwrite := OverwriteBehavior.Never RETURN