ILE RPG Programmer's Guide


Normal End for a Cycle-Main Procedure

A cycle-main procedure ends normally and control returns to the calling procedure when the LR indicator is on and the H1 through H9 indicators are not on. The LR indicator can be set on:

A cycle-main procedure also ends normally if:

When a cycle-main procedure ends normally, the following occurs:

On the next call to the cycle-main procedure, with the exception of exported variables, a fresh copy is available for processing. (Exported variables are initialized only once, when the program is first activated in an activation group. They retain their last assigned value on a new call, even if LR was on for the previous call. If you want to re-initialize them, you have to reset them manually.)

TIP

If you are accustomed to ending with LR on to cause storage to be released, and you are running in a named (persistent) activation group, you may want to consider returning without an end. The reasons are:

You would only want to do this if you did not need your program re-initialized each time.


[ Top of Page | Previous Page | Next Page | Contents | Index ]