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



Folks:

I just noticed something interesting ... some rules got tightened in the RPG compiler between V5R4 & 6.1.

We have a procedure that returns a 4,0 number ... the prototype & interface both specify the return value.

The procedure is coded with multiple exit points. One in the middle of the logic (a short circuit exit) and another at the very end.

The short circuit exit is coded as 'return value;'. The exit at the end is just a 'return;'. Clearly a coding error.

On the face of it, I would expect this compile to fail due to the lack of a return value on the 2nd return. But, on V5R4, it doesn't. The compile WILL fail if neither of the return statements specify a value.

On 6.1, however, the compile DOES fail because the 2nd return statement doesn't specify a value.

I'm kind of curious as to what value the caller received if the 2nd return was executed. Zero perhaps?

david


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.