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



We are at V5R4.

"Alan Campin" <alan0307d@xxxxxxxxx> wrote in message
news:<mailman.48856.1307983564.2702.rpg400-l@xxxxxxxxxxxx>...
What release level are you at? V6R1 you can call programs recursively
using
the Main keyword.

On Mon, Jun 13, 2011 at 10:40 AM, Carel Teijgeler
<coteijgeler@xxxxxxxxx>wrote:

What about two different Named Activation Groups? PROGRAMA runs in
one,
the other programmes in the other.

Or use the Environment APIs.

With regards,
Carel Teijgeler

*********** REPLY SEPARATOR ***********

On 13-6-2011 at 11:27 Lim Hock-Chai wrote:

I've a program, PROGRAMA, that accepts two entry-parms. This
program
calls PROGRAMB, which in turn calls PROGRAMC. I've a need to
change
PROGRAMC to now call PROGRAMD. However, PROGRAMD, which is an
existing
program, already has code to call PROGRAMA. Of course, the causes
the
recursive call problem.

I've a wild idea to resolve this recursive problem and want to see
what's your opinion about this:
The reason that PROGRAMD needs to call PROGRAMA is becuase it needs
a
value on the PROGRAMA's entry-parms, which is already populated by
PROGRAMA by the time PROGRAMD is called.

My idea is to create an export procedure in a service program.
This
procs will accepts the PROGRAMA's two entry-parms by reference.
The
main code in this service program is to create a static references
to
these two entry-parms. I can then change PROGRAMD to call this
proc to
get the value it needs thru these static references. I know is a
bit
confusing. May be code below and clear up a bit:

The code for this proc would looks something like this:
*************************************************************
P cumPROGRAMAParms...
P B export
D pi n
D piAction 1
D piPgmAParm1 likeds(PGMAParm1)
D piPgmAParm2 likeds(PGMAParm2)

D myPgmAParm1 ds likeds(PGMAParm1)
D based(myPgmAParm1_p)
D myPgmAParm2 ds likeds(PGMAParm2)
D based(myPgmAParm2_p)
D myPgmAParm1_p s * static
D myPgmAParm2_p s * static


/free

select;
when piAction = 'set';
myPgmAparm1_p = %addr(piPgmAParm1);
myPgmAparm2_p = %addr(piPgmAParm2);
return @SUCCESSFUL;

when piAction = 'release';
myPgmAparm1_p = *null;
myPgmAparm2_p = *null;
return @SUCCESSFUL;

when piAction = 'get';
if myPgmAparm1_p <> *null and myPgmAparm2_p <> *null;
piPgmAparm1 = mypiPgmAparm1;
piPgmAparm2 = myPgmAparm2;
return @SUCCESSFUL;
else;
return not @SUCCESSFUL;
endif;
endsl;

return not @successful;

/end-free

P cumPROGRAMAParms...
P E
--
This is the RPG programming on the IBM i / System i (RPG400-L)
mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



-----
Geen virus gevonden in dit bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 10.0.1382 / Virusdatabase: 1513/3697 - datum van uitgifte:
06/12/11



-----
Geen virus gevonden in dit bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 10.0.1382 / Virusdatabase: 1513/3697 - datum van uitgifte:
06/12/11



--
This is the RPG programming on the IBM i / System i (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.