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



Mark S. Waterbury wrote:
Hi, Joe:

If it was my shop or my decision, I would try something like this first.

1. ensure that each top-level RPGLE program always returns with *INLR = *ON (so that it closes all files, etc.) and specify ACTGRP(*NEW) as was suggested previously. That way, each time the program exits, the AG gets cleaned up. Then see if any users complain about the extra time it takes when they return to a menu option they have visited recently.

2. if many users complain, then you could change the above to ACTGRP(named) and set *INLR = *OFF. Then, you leave everything open, as you are doing now.
2.(a) you might even want to replace those "top-level" programs with small CL programs that call the previous "top level" program, and on return, it could pop-up a window to ask the user if they plan to re-use this menu option within the next 5 minutes. If they answer "No", it could then issue RCLACTGRP ACTGRP(name) ...?
(This lets the user decide whether to leave the files open or not.)
The cool thing about *NEW is that you don't have to specify *INLR = *ON. You can leave it off, and everything is cleaned up when the AG exits. I've used this extensively; it completely replaced my old cleanup utilities. I actually had a small driver that all subprograms registered with; the driver would then call them to clean themselves up when the top-level program ended, but I don't need that with *NEW/*CALLER.

As soon as you throw named groups in the mix, it's now your responsibility to reclaim them. That's not necessarily a bad thing, just an extra task that you have to do. But you have to design carefully; if you leave *INLR off and you don't use *NEW, then the next time you invoke the program, *INZSR won't be called, variables may not be initialized properly (especially STATIC variables), that sort of thing (exactly the same sorts of issues you run into with *INLR OFF). You have to take a little extra care there.

Joe

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.