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


  • Subject: RE: return indicator
  • From: "Ray, Adam" <aray@xxxxxxx>
  • Date: Tue, 30 Jan 2001 09:28:42 -0600

Return Indicator (RT)
You can use the return indicator (RT) to indicate to the internal RPG logic
that control should be returned to the calling program. The test to
determine if RT is on is made after the test for the status of LR and before
the next record is read. If RT is on, control returns to the calling
program. RT is set off when the program is called again.
Because the status of the RT indicator is checked after the halt indicators
(H1 through H9) and LR indicator are tested, the status of the halt
indicators or the LR indicator takes precedence over the status of the RT
indicator. If both a halt indicator and the RT indicator are on, the halt
indicator takes precedence. If both the LR indicator and RT indicator are
on, the program ends normally.
RT can be set on as a record identifying indicator, a resulting indicator,
or a field indicator. It can then be used as a conditioning indicator for
calculation or output operations.
...

RETURN (Return to Caller)
The RETURN operation causes a return to the caller....
... When a program or main procedure returns, the following occurs:
1.      The halt indicators are checked. If a halt indicator is on, the
procedure ends abnormally. (All open files are closed, an error return code
is set to indicate to the calling routine that the procedure has ended
abnormally, and control returns to the calling routine.)
2.      If no halt indicators are on, the LR indicator is checked. If LR is
on, the program ends normally. (Locked data area structures, arrays, and
tables are written, and external indicators are reset.
3.      If no halt indicator is on and LR in not on, the procedure returns
to the calling routine. Data is preserved for the next time the procedure is
run. Files and data areas are not written out. 
...

So, in a broad sense, the answer to your question is yes. 

        
        We're looking at an RPG pgm written in 1983.  Before the pgm returns
to its
        caller, it sets on the RT indicator.  Is this functionally
equivalent to
        using the RETURN op code?  Thanks.

        
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.