Solved

IN A VB6 SUB GETTING THE NAME OF SUB DURING RUNTIME

Posted on 2007-12-06
3
440 Views
Last Modified: 2008-02-01
I have at main.form a hidden  dummy label,  on event when it changes I jump to popup(forced)
Its caption get sa value if in a sub is a error like:

Private sub Something
on error goto Report
'some code......
exit sub
Report:
Thelabel.caption= " error n# " & str$(err) & " in line " & str$(erl)  & "in submodule: &  ???    ????????? now here i would like to add the name of this sub???
so the label will show      " error n# x   in line  x   in module Someting
resume next
end sub
 
0
Comment
Question by:BIAPRO
[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 65

Expert Comment

by:Jim Horn
ID: 20423625
>???    ????????? now here i would like to add the name of this sub???
There is no variable or property that contains the name of the sub that is currently running.  You'll have to type it in manually in every sub.
0
 
LVL 31

Expert Comment

by:Frosty555
ID: 20424891
The best you have is
Err.number      -   error code number
Err.description   -  description of error as it appears in the error window in vb
Err.source     - usually the name of the project, but if you raise your own errors using Err.raise() you can specify what the value is
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 500 total points
ID: 20427495
This free add-on for VB6:

http://www.mztools.com/v3/download.aspx

Has a feature to add error handling that uses templates and markers to add code to a procedure.  You can change the template for your own style of error handling.  One of the variables it can use is the procedure name.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

#Citrix #POC #XenDesktop #vCenter #VMware #ESX
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

751 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