|
I guess I responded to this message before you sent it.. see my other post for how to use the RPG xTools GetCallerInfo() procedure to do this. Otherwise you can roll your own with the snd/rcv message APIs. -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 Jeff Young Sent: Friday, August 19, 2005 9:54 AM To: RPG programming on the AS400 / iSeries Subject: RE: Get name of current procdeure Bob, I am not sure I understand. Would I use the Send Program Message API or the Send NonProgram Message API? If so, what program message queue do I send it to? If not, what message queue do I send it to? For receive, which API do I use? Would the data for the procedure that called the log procedure be in the Sender Information section for the receive API? Thanks, Bob Cozzi <cozzi@xxxxxxxxx> wrote: 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 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 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.