From: Gregory A. Beamer on 14 Dec 2009 10:38 "(PeteCresswell)" <x(a)y.Invalid> wrote in news:65r4i5degihhkm1apulj5tgt8gao82gmln(a)4ax.com: > Are line numbers in VB.NET coding totally passe'? > > I've used them for years in VBA coding. My error trapping > writes the error and line number to a .txt file and it's been > very helpful in speeding up the process of finding/fixing errors. > > Or is there some functional equivalent in the .NET scheme of > things? The line numbers are there in .NET, but you don't type them in. When you get a stack trace, you will get a line number. Turn on line numbers in Visual Studio and viola ... they correspond. So there is no reason to have typed in line numbers any more. As far as finding/fixing errors go in .NET, there are two suggestions; 1. Learn how to use the debug tools. 2. Learn enough about the framework to be able to decode what the stack tells you about an error. On point #2: Often times, people post a stack trace here asking what is going on. If the poster had taken a bit of time reading the stack, the classes would give away what many of hte errors were. Understanding the flow of the stack would give away others. And being able to find the erroring class in the help files would solve another heap of issues. It is not a 100% thing, but it is well over the 80% mark. Peace and Grace, -- Gregory A. Beamer (MVP) Twitter: @gbworld Blog: http://gregorybeamer.spaces.live.com ******************************************* | Think outside the box! | *******************************************
From: Gregory A. Beamer on 14 Dec 2009 10:41 "(PeteCresswell)" <x(a)y.Invalid> wrote in news:7i25i5hb8d1i9mm09ruc5co9b30nf2n42i(a)4ax.com: > Is it common practice to have a single error handling routine > that is called by "Catch" - and which writes relevant info to a > .txt file? It depends on where the try ... catch is. if you bubble everything up to the UI, then sending everything to a single logger may make sense, as your primary purpose of this type of exception handler is to make sure the user does not see ugly error messages. If you are capturing exceptions lower down in the layers, you may call a single logger, but it is unlikely you would have a single "On Error Goto Label" type of catch mechanism (ala VB6 or VBA). Peace and Grace, -- Gregory A. Beamer (MVP) Twitter: @gbworld Blog: http://gregorybeamer.spaces.live.com ******************************************* | Think outside the box! | *******************************************
First
|
Prev
|
Pages: 1 2 3 Prev: unhandled exception has occurred.. Next: creat DBF in server 2005 with windows vista |