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



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.

This thread ...

Replies:

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.