Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB source "FILE", "LINE" information

Posted on 1998-07-02
3
Medium Priority
?
309 Views
Last Modified: 2008-03-10
In "C" you can use __FILE__ and __LINE__ to let the precompiler insert the source filename and source linenumber in that spot in your code. Does VB have something similar ??
I want to write a generic "Error logging" function that includes this information in the error entry. On the call to the LogError function I want to include the source filename and the line number (or at maybe the current function or sub name ?).
eg.
Call LogError(__FILE__, __LINE__, some, other, parms)
I do not want to hardcode the source file name & line number. I would hate to start numbering lines or write an Add-In to do this
0
Comment
Question by:EnricoS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 360 total points
ID: 1464799
VB Does not allow for this.  The file name problem is out of the question.  I wrote an Addin to handle the filename problem.  As far as the line numbering is concerned, you will have to number lines.  Once you number lines, you can use the undocumented variable called ERL to get the line number where the error occured.
0
 

Expert Comment

by:74wolfgang
ID: 1464800
i´m not sure but look out for listbox, listcount and listindex in the vb helpfile or MSDN.
line input

hope this help a bit

bye
0
 

Author Comment

by:EnricoS
ID: 1464801
Somewhat disgusting !!! Any hope that VB 6 will have this ?? (or that the guys at Microsoft reads this & add it to a later version ??)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question