GridLinx Software

Home Up User's Comments VB DocuMentor Privacy Policy Purchase DownLoad CopyProjectLite Books VB FAQ Technical Support Annoyances Tips Links Visual Basic 3

Why Line Numbers?




Why Bother With Line Numbers?

Read an Expert's opinion:

Peter Morris, in  Advanced Microsoft Visual Basic 6, Chapter 1: "On Error Goto Hell".
Order Advanced Microsoft VB 6"... In Visual Basic, Erl, a Visual Basic (undocumented in Visual Basic 4 and 5 but present in all versions of Visual Basic thus far) "global variable," gives you access to the line number of any erroring line of code. So by using line numbers and by using Erl in your error handlers, you can determine which line of code erred--wow! What happens to Erl if you don't use line numbers? Easy--it will always be 0."
"At TMS, we don't work with line numbers in our source code, however. We add them only when we're doing a ship build--that is when we want to ship a binary to, say, beta testers or to manufacturing for an impending release. We use our internal tool to build a new version of the code, complete with line numbers, and then we make an executable from that. We store the line numbered source code in our source control system and ship the executable. We cross-reference the EXE version number (the Auto Increment option is just great here) to the source code stored in the source control system. Every time we do a new build for shipping, we create a new subproject whose name is the version number of the build and store the line numbered source code in it along with a copy of the binary image. If an error report comes in, we can easily refer back to the source code to find the erroring line (very, very easy if you're using Microsoft Visual Source Safe). Typically, the error report will contain details of the module, routine, and line number of the error."


Send mail to with questions or comments about this web site.
Send mail to for product information, questions, or suggestions.
Copyright 1998,1999,2000,2001,2002 GridLinx Software.
Last modified: September 30, 2001
Trademarks:  Visual Basic, Windows, Windows NT, Windows 2000, Windows 95 and Windows 98 are all registered trademarks of the Microsoft Corportation.