Babara:
Would it be possible to add special parameter value that developer can
use to alter the execute sequence of any calling procedure? I'm think
special value like *initialize and *shutdown. When these special value
is used, the calling procedure will only execute the *initialize or
*shutdown subroutine of the calling procedure.
For example:
Calling procedure would look something like below
P myProc B
D pi
D piParm1 1 const
D piParm2 10
/free
. . .
. . .
Begsr *initialize;
. . .
endsr;
Begsr *shutdown;
. . .
endsr;
/end-free
P myProc E
The caller can then call above procedure in 3 different ways:
/free
myProc(*initialize);
myProc('A' :'ABCD');
myProc(*shutdown);
/endfree
Add to this wish list?
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Barbara Morris
Sent: Thursday, February 07, 2008 4:02 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Static Variables in a subprocedure
Barbara Morris wrote:
... There's a way to get around it: Create a second prototype for the
procedure with the same EXTPROC, but no parameters; ...
I forgot to say that using EXTPROC('myproc') will only work if the
procedure is exported.
If the procedure is local to the module, you have to use this technique
to call it with a different prototype.
D myproc pr
D ... parms ...
D myproc_reset pr extproc(myproc_procptr)
D myproc_procptr s * procptr inz(%paddr(myproc))
--
This is the RPG programming on the AS400 / iSeries (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.