By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,364 Members | 1,536 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,364 IT Pros & Developers. It's quick & easy.

Determine What is Calling my Subroutine

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
> 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 discussion thread is closed

Replies have been disabled for this discussion.