×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Sharon,

You could also use the system information datastructure to get the program name, instead of defining a constant. That way, if you change the name of the program or copy program into another, you don't have to remember to change the constant value.

D SysInfo sds
D pgmq *proc

On 5/13/2010 10:04 AM, Wintermute, Sharon wrote:
Hadn't thought of that. Thank you and thank you Simon.

Sharon Wintermute

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Rory Hewitt
Sent: Wednesday, May 12, 2010 5:11 PM
To: RPG programming on the IBM i / System i
Subject: Re: QMHSNDPM

Sharon,

In all my programs, I define a global constant called 'ThisProgram,
which I
use to define the main procedure (i.e. program) interface e.g.:

D ThisProgram C 'CRTMIPGMR'

D main PR Extpgm(ThisProgram)
D P_qPgm 20A Const
D P_qSrcf 20A Const
D P_SrcMbr 10A Const
D P_Text 50A Const
D P_Option Const Like(Option)
D P_qPrtf 20A Const
D P_Aut 10A Const

D main PI
D P_qPgm 20A Const
D P_qSrcf 20A Const
D P_SrcMbr 10A Const
D P_Text 50A Const
D P_Option Const Like(Option)
D P_qPrtf 20A Const
D P_Aut 10A Const

My SndPgmMsg() subprocedure (which is defined ain a copybook and then
brought into the program code that way) pass this value to the
CallStackEntry parameter of QMHSNDPM.

Works like a charm.

Rory

On Wed, May 12, 2010 at 11:26 AM, Wintermute, Sharon<
Sharon.Wintermute@xxxxxxxxxxxxxxxx> wrote:

I have several shell routines that were subroutine based using Message
Control subfiles. I am trying to create a basic shell that is
procedure
based and the main holdup is QMHSNDPM/QMHRMVPM.

I can get a /include version to work at the main level, but once you
get
nested within procedures it doesn't work very well. It looks like I
need to interrogate the call stack in order to get back to the initial
PEP. Am I headed in the right direction?

TIA,

Sharon Wintermute


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-2026 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.