473,803 Members | 3,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automatic line numbering crazyness

Ben
Hello all

After years of playing developing stuff for fun and personal use I'm
finally developing an app that I am intending to sell. As such, I'm
trying to make it as reliable and stable as possible and also ensuring
that it fails gracefully.

So, I'm trying to use the Erl property of the Err object so the users
get a line number as part of the error if things go wrong to make
troubleshooting easier.

However, it seems that you have to enter the line numbers manually in
your code which seems a little bizarre to me. In VB in VS2003 you can
turn on line numbers - I assumed that would enable line numbers in my
app but it doesn't. All it does it show you the line numbers but doesn't
actually embed them in the code leaving you having to enter your own. It
seems bizarre to me that the "turn on line numbers" or whatever option
is called turns them on for display only, leaving you to manually type
in your own.

Are there any workarounds for this? With all the work I'm going to be
going I really don't want to have to type in line numbers too if I can
possibly help it.

Cheers
Ben
Nov 21 '05 #1
2 1558
I think that the Err object is a holdover from old VB and you should
definitely be using a structured exception handling scheme in your code.

Exceptions will report the specific line of code on which the error
occurred.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Ben" <be*@ucan2.co.u k> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hello all

After years of playing developing stuff for fun and personal use I'm
finally developing an app that I am intending to sell. As such, I'm trying
to make it as reliable and stable as possible and also ensuring that it
fails gracefully.

So, I'm trying to use the Erl property of the Err object so the users get
a line number as part of the error if things go wrong to make
troubleshooting easier.

However, it seems that you have to enter the line numbers manually in your
code which seems a little bizarre to me. In VB in VS2003 you can turn on
line numbers - I assumed that would enable line numbers in my app but it
doesn't. All it does it show you the line numbers but doesn't actually
embed them in the code leaving you having to enter your own. It seems
bizarre to me that the "turn on line numbers" or whatever option is called
turns them on for display only, leaving you to manually type in your own.

Are there any workarounds for this? With all the work I'm going to be
going I really don't want to have to type in line numbers too if I can
possibly help it.

Cheers
Ben

Nov 21 '05 #2
Line numbers in VS.NET are only for visual purposes. They are not for error
reporting as it was in VB6 with the Erl function. In .NET you use
exceptions, which tell you the class and procedure name of the exception.
While using the Debug configuration (a .pdb file is generated), they tell
also the file and line number where the exception was thrown. So, you will
have to read the docs a bit about Structured Error Handling (try, catch,
finally, throw, etc.).

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"Ben" <be*@ucan2.co.u k> escribió en el mensaje
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hello all

After years of playing developing stuff for fun and personal use I'm
finally developing an app that I am intending to sell. As such, I'm trying
to make it as reliable and stable as possible and also ensuring that it
fails gracefully.

So, I'm trying to use the Erl property of the Err object so the users get
a line number as part of the error if things go wrong to make
troubleshooting easier.

However, it seems that you have to enter the line numbers manually in your
code which seems a little bizarre to me. In VB in VS2003 you can turn on
line numbers - I assumed that would enable line numbers in my app but it
doesn't. All it does it show you the line numbers but doesn't actually
embed them in the code leaving you having to enter your own. It seems
bizarre to me that the "turn on line numbers" or whatever option is called
turns them on for display only, leaving you to manually type in your own.

Are there any workarounds for this? With all the work I'm going to be
going I really don't want to have to type in line numbers too if I can
possibly help it.

Cheers
Ben

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2679
by: RotterdamStudents | last post by:
Hello group, the script on this page i use to show the standings in a league. It is shown in a table on my webpage. But I don't know how to number the rows so that the first row is number 1 the second 2 and so on, so that the numbers are equal to the standings. Who has a solution for this. Thnx.
5
2875
by: fatih kayaalp | last post by:
Hi, i have imported an access database into sqlserver 2000. In access, i have some table fields which were using automatic number as datatype. But i see that there is not a datatype in sqlserver like automatic no. I have to enter id numbers to my tables for each records automatically. Would anybody help me about solving this problem? Any idea? Thanks
48
8716
by: David J Patrick | last post by:
I'm trying to rewrite the CSS used in http://s92415866.onlinehome.us/files/ScreenplayCSSv2.html. using the w3.org paged media standards as described at http://www.w3.org/TR/REC-CSS2/page.html The ScreenplayCSS is flawed, for several reasons; -overuse of <div id= tags -doesn't scale screen resolutions (convert from px to in, pt ?) -no media="print" (how much coule be shared between "screen" & "print") -no automatic page breaks (with...
0
1340
by: Juan Romero | last post by:
Hey guys, Does anyone out there have a good method to do line numbering in a richtextbox control? This seemed simple at first glance, but It has proven to be a tough task. I want to create a control derived from the richtextbox control with a line numbering feature. Any thoughts welcomed.
3
2940
by: Jim Bancroft | last post by:
Hi all, In VB6 I used a 3rd party tool for line numbering my source code, to help with debugging. However, in experimenting with VB .Net I've noticed that my exceptions automatically provide line numbers, with no effort required from me. Is this a standard offering in .Net, or is rolling your own line numbers still the way to go? Also, my components at the moment are being compiled in debug mode. Will line numbers still be available...
1
1757
by: Michael Doubez | last post by:
Hello, I want to mix in the same document Parts that have automatically numbered sections and parts which section are not numbered. Is there any out of the box way to locally suppress the automatic numbering of section like in latex using \section*{} instead of \section{} ? Or should I customize the XSLT with a new kind of section
2
1392
by: =?Utf-8?B?R3VzIENodWNo?= | last post by:
I can’t find the line numbering on/off in the option box. Am I missing something? Can any one help me. I’m using visual studio C# 2005 express edition thank You Gus
8
1830
by: Wayne | last post by:
When I couldn't find it on-line by Googling, I spent all last night working it out. And it works, Yea! All you do is mark the PRE sections you want numbered with a "marker" style like this: .... <style ...> ..numbered {} </style> ....
0
1471
by: cephal0n | last post by:
Hi All! I have two table tblHome1, contains all the unique PinNo and tblHome2 contains a duplicated PinNo and description. I put an automatic numbering (ProdID) and set it as my index. What I want to do is make an automatic filtering and labeling method for my table. The reason for this is because I m handling more than 500 records and labeling them would take me forever, so I started with what I can understand, which is seeking 5 records...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10309
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10289
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9119
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6840
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.