473,657 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2261
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*****@fooema il.com> wrote in message
news:e6******** ******@TK2MSFTN GP10.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
4964
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 attempt to call the subroutine. The subroutine is actually invoked maybe 2 out of 10 times run. What could possibly be the reason for this?? Why the inconsistency in running the subroutine? Cheers
2
4044
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 edit. I have several programs to add this to and I thought of adding a common subroutine versus adding duplicate code would be easier to maintain. The problem is from the calling COBOL program to the calle COBOL program I get a -924 (which is no DB2...
30
2269
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 nested do loops, going through the records in rst using .movenext. At one point in one of the loops, we'll say the rst is at record "a". Now, another subprocedure is called, passing rst to it. In the subprocedure, the recordset goes through a...
12
2894
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 wload(starttime, duration, station, component, dataray, nsamp, calib, srate, samplength, datadir)
5
4348
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 subroutine I used the following name: modulename_MP_subroutinename_(...) and all possible variant (upper case,lower case).Can anybody help (for a unix system)
11
543
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 create a dynamic link library. The beginning of the fortran code looks like: SUBROUTINE SFTCK3 !DEC$ ATTRIBUTES DLLEXPORT::SFTCK3
2
1434
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! **************************************************************************************************** Original Question: -------------------- Has anyone called a COBOL subroutine using COBOL CALL from a COBOL/DB2
0
1005
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 button should be clicked to send the message. Postback is occurred. Message.aspx will be used again to show the confirmation message. I encounter a issue in this stage? As i understand, all event handlers will be executed after all page_load...
7
5515
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 example to illustrate the question rather than to try to ask the question in general terms. Assume there is a table with these records
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.