473,386 Members | 1,606 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,386 software developers and data experts.

Determine What is Calling my Subroutine

I've got a subroutine, defined as Private, takes two parameters, that is
called lots of times from different ASP scripts. I need specific error
handling when it is called from only one particular section of my code - and
from the page it's called from, it's called multiple times from there, too,
so I can't check by page.

I thought about adding an additional parameter, but it's called so many
times that it would be unwieldy to do so.

Is there a way I can tell a Private Subroutine what piece of code called it?

ba
Jul 19 '05 #1
3 2254
Bill wrote:
I've got a subroutine, defined as Private, takes two parameters, that
is called lots of times from different ASP scripts. I need specific
error handling when it is called from only one particular section of
my code - and from the page it's called from, it's called multiple
times from there, too, so I can't check by page.

I thought about adding an additional parameter, but it's called so
many times that it would be unwieldy to do so.

Is there a way I can tell a Private Subroutine what piece of code
called it?

ba


No. You'll have to add the extra parameter.
Jul 19 '05 #2
No, but you can put some error trapping in the sub to perhaps give you an
idea:

sub whatever(x,y)
on error resume next
your code
If err.number <> 0 Then
response.write "An error occurred. Here are the argument values that
were passed.<br>"
response.write x & "<br>"
response.write y
response.end
End If

End Sub

Ray at work

"Bill" <no*****@fooemail.com> wrote in message
news:e6**************@TK2MSFTNGP10.phx.gbl...
I've got a subroutine, defined as Private, takes two parameters, that is
called lots of times from different ASP scripts. I need specific error
handling when it is called from only one particular section of my code - and from the page it's called from, it's called multiple times from there, too, so I can't check by page.

I thought about adding an additional parameter, but it's called so many
times that it would be unwieldy to do so.

Is there a way I can tell a Private Subroutine what piece of code called it?
ba

Jul 19 '05 #3
> No. You'll have to add the extra parameter.

Or, create a second subroutine, which calls the first *and* does the
logging, and change only those calls where you want the different behavior.
Might save a bit of work...
Jul 19 '05 #4

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

Similar topics

4
by: Michael Farber | last post by:
Not sure if this is the right group for this but anyways... I've got an ASP web application that uses a Visual Basic component to do some work. I instantiate the component in asp and then...
2
by: Giulio Belrango | last post by:
Hi I need someones help I'm working in an IBM 390 batch environment. What I'm trying to do is to call from a non DB2 COBOL program a DB2 COBOL program that will access a table and perform an...
30
by: Tim Marshall | last post by:
Here's the scenario, A2003, Jet back end, illustrated with some cut down code at the end of the post: A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens it. There are several...
12
by: Bigdakine | last post by:
I don't know if this is the right forum for this, and if not please suggest one which fits. I have to call a fortran sub routine from a C main program. The fortran subroutine statement is ...
5
by: Amit | last post by:
I tried calling a subroutine in a fortran module from C ,but couldn't.I always get the error: undefined reference in the main.o file (main is in C calling the subroutine). for calling the...
11
by: RichN | last post by:
I am developing a c program in Visual Studio .NET 2003. I also have an Intel(R) Fortran compiler for MVS .NET My fortran sourcecode already existed. I started a new fortran project and chose to...
2
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
0
by: KY Lui | last post by:
I am developing a simple message sending application. A page (message.aspx) is used for message writing and message status confirmation. eg. A user access message.aspx to write a message, a send...
7
by: mirandacascade | last post by:
Note: I'm not sure if the subject line of this post uses the correct terminology, so apologies if the subject line turns out to be misleading. I think it's probably easier to provide a trivial...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.