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



Eric,
>>> For the storage defined in the NOMAIN module to be re-initialized,
you would need to seton LR before returning from that module.  This sets a
switch that causes global storage to be re-initialized on the next call.
(Note that this has no effect on local static variables that are declared in
the procedures.)

I don't believe this to be true unless you have the RPG Cycle main-line
Calc's of that secondary module being called as a procedure and the you set
on *INLR in that secondary main module. But since you said "NOMAIN" the
state of *INLR in a module with NOMAIN does not impact the global variables;
in my experience. 

-Bob

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of DeLong, Eric
Sent: Monday, January 10, 2005 2:12 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: A different kind of persistence?

Dane,

Your q:
"Eric D. - yes, I think all of what you stated is accurate.  Named
activation group for all programs (*PGM objects) called from this job.
However, some of your comments contradict those of Bob C's regarding the
persistence of data.  Does LR have no impact on global variables within
an activation group...period, the end?"

LR has impact within the scope of the module where it was set.  In this
case, you set LR in the MAIN module of your program, and not in the NOMAIN
module.  For the storage defined in the NOMAIN module to be re-initialized,
you would need to seton LR before returning from that module.  This sets a
switch that causes global storage to be re-initialized on the next call.
(Note that this has no effect on local static variables that are declared in
the procedures.)

Even though you are binding the module by copying it into your *PGM, the
rules of activation group resource scoping are still at play.  Once the
module get started in the AG, it remains persistent until the job ends or
the AG is reclaimed.  Setting LR within the module does not cause resources
to be reclaimed as they do in RPG/400.  



Eric DeLong
Sally Beauty Company
MIS-Project Manager (BSG)
940-898-7863 or ext. 1863


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