473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Sub name and line number

Hi

For error logging purpose, is it possible to get from the vb system feature
the SUB name and the line number?

Thanks

Regards
Apr 3 '07 #1
2 1425
On Apr 3, 9:12 am, "John" <J...@nospam.infovis.co.ukwrote:
Hi

For error logging purpose, is it possible to get from the vb system feature
the SUB name and the line number?

Thanks

Regards
AFAIK, when the release version is used, you will only be able to get
the il name of the method, and not what you actually named it (and if
you obfuscated the code good luck getting anything useful!). The good
news is the the Exception object contains a StackTrace property which
should give you this information. I believe the line number will
vanish completely in the release version.

Usually, you can figure out where something went wrong with just the
exception message and stack trace, though not always. Typically, I log
a timestamp, who the user was, the exception's message and stack trace
as well as any inner exceptions. If I can't figure what happened from
the message and trace I can go to the user and ask them what happened.
(Be warned I work on internal programs only - so I have a bit more
luxury when it comes to communicating with my end-users. It is
generally a bad idea to really on your consumers to find your bugs!)

Thanks,

Seth Rowe

Apr 3 '07 #2
The exception should already return the sub name (actually the whole call
stack). AFAIK you can't get the line number in a release build (even with
PDBs if for nothing else because compiler optimizations are likely to break
the code/line association anyway). Breaking down a long procedure into
smaller units may help.

---
Patrice

"John" <Jo**@nospam.infovis.co.uka écrit dans le message de news:
%2****************@TK2MSFTNGP03.phx.gbl...
Hi

For error logging purpose, is it possible to get from the vb system
feature the SUB name and the line number?

Thanks

Regards

Apr 3 '07 #3

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

Similar topics

1
by: Marek Prerovsky | last post by:
Hello, I implemented some Python functions in my C/C++ code. I need to know the Python source file name and line number of just executed Python command which calls my function. How can I get...
11
by: Ken Varn | last post by:
I want to be able to determine my current line, file, and function in my C# application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___ macros for getting this, but I cannot find a...
2
by: pythonnewb | last post by:
I am fairly new to programming but have some very basic Java background. I am just learning python and tried to make a module that would allow me to create a file containing an address book. I was...
2
dlite922
by: dlite922 | last post by:
I'm reading a CSV file and the firstname and last name are together separated by a space. (There could be middle name or middle initial as well, but is being ignored) Since i'll be doing this...
1
by: santoshsri | last post by:
Hi All, My C# web application calls a webservice to process a report. It sends XMLs as parameter and in response gets an XML node which stores Binay datatype bin.base64. It makes an instance of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.