Solved

Error routine

Posted on 2001-07-24
6
265 Views
Last Modified: 2013-12-18
Hello Friends,
   i want to do folowing type of functionality.
   in main routine i hae error handler. and some sub routines have been called. in that subroutine if error raises then i want to pick that subroutines name parameter( so that in main routine i can understand where error is raised) pass it to main routine. is it possible?
thanks,
shrirang  
0
Comment
Question by:shrihalbe
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6314107
It cannot give you dynamically what sub has raised the error, you have to code it accordingly. That is hard code the sub, as you will not change the name often for the sub it is OK !

~Hemanth
0
 

Author Comment

by:shrihalbe
ID: 6314176
Hello Hemanth,
That is fine. i am not going to change the name of the routines. but some error occurs in subroutine then control will move to main routine error handler and it passes the name of the subroutine in which error occured. so that i can send mail to administrator where error has occured

Thanks,
 shrirang
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6314218
Notes log would be appropriate to log the errors so that from anywhere you can log the errors.

0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:shrihalbe
ID: 6317479
i want to take action when error occurs in the main routine. not in the subroutine. so i want some parameter to be passed from the suroutine and in main error routine i would write code to handle that coresponds to subroutine.
      another think what i feel that. once error occurs in the subroutine then subroutine error handler will handle that error and that won't pass control to main routine error handle. where actually i want to write a code.

thanks,
shrirang
0
 
LVL 2

Accepted Solution

by:
typerracer earned 30 total points
ID: 6319730
Shrirang,

It sounds like you want a way to identify what subroutine raised the error being reported by the main error routine.  If so, try the following:

' In the global Declarations define g_sCurrentSubroutine

Dim g_sCurrentSubroutine as string

' at the beginning of each subroutine, add the following lines of code:

Dim sLastSubroutine as string

sLastSubroutine = g_sCurrentSubroutine
g_sCurrentSubroutine = <insert subroutine name here>

' the last line of each subroutine should read:

'reset the current subroutine name only upon successful completion of the subroutine
g_sCurrentSuboutine = sLastSubroutine
0
 

Author Comment

by:shrihalbe
ID: 6334953
Thanks  typerracer ,
  Really appreciated.
Shrirang
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
Recent Contacts - Lotus Notes 10 694
VBA Lotus notes 2 199
Migration: Lotus Notes to Exchange 2013 10 330
Lotus Domino Server 9 4 93
For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 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