× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Jeffery,
Why not in your service program's procedure, perform a "find my caller"
routine and avoid passing in the name of the procedure altogether?
You can use snd/rcv message to do that.


-Bob Cozzi
www.RPGxTools.com
If everything is under control, you are going too slow.
- Mario Andretti

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Jeffrey Young
Sent: Friday, August 19, 2005 7:55 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Get name of current procdeure 

Scott,
I have a service program that is processing various types of data input and
returning a formatted string.
If the procedure being called encounters an error, I send back a return code
to the caller.
I am enhancing that to send a message to QHIST and the users job log.
One of the parms I am passing to my generic logging routine is the name of
the procedure the error occured in.
Currently, I am hard coding it, but would like to be able to have a variable
that I can pass instead.  This way, if I clone one of the procedures, I do
not have to remember to change the name in the error handling code.
 
Thanks,


Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote:

> In a Sub-procdeure, is there any way to get the name of the procedure 
> being executed?

The subprocedure name is in the callstack. You can use an API to get 
retrieve the call stack entries, or you can send a message to yourself and 
see who it came from :)

Neither of these are ideal or perform particularly well.

What are you trying to accomplish? Maybe I'd have some better suggestions 
if I knew the business problem you were trying to solve...

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.