|
What release level are you at? V6R1 you can call programs recursivelyusing
the Main keyword.<coteijgeler@xxxxxxxxx>wrote:
On Mon, Jun 13, 2011 at 10:40 AM, Carel Teijgeler
one,
What about two different Named Activation Groups? PROGRAMA runs in
programthe 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
changecalls PROGRAMB, which in turn calls PROGRAMC. I've a need to
existingPROGRAMC to now call PROGRAMD. However, PROGRAMD, which is an
theprogram, already has code to call PROGRAMA. Of course, the causes
arecursive 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
Thisvalue 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.
Theprocs will accepts the PROGRAMA's two entry-parms by reference.
tomain code in this service program is to create a static references
proc tothese two entry-parms. I can then change PROGRAMD to call this
bitget the value it needs thru these static references. I know is a
mailingconfusing. 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 listlist
To post a message email: RPG400-L@xxxxxxxxxxxx06/12/11
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:
--
This is the RPG programming on the IBM i / System i (RPG400-L)
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 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.