ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

RNX0224 RPG procedure ended without returning a value

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RNX0224 RPG procedure ended without returning a value

    I was quite surprised to find that it's possible for an RPG procedure which is defined as returning a value to end without returning a value. When this happens escape message RNX0224 ('RPG procedure &1 ended without returning a value') is sent and the call to the procedure ends in error (RNQ0202).

    I had assumed (wrongly) that the compiler would disallow any such procedures with an error such as RNF5415, but apparently as long as at least one RETURN operation exists within the procedure then it compiles successfully.

    Is it known what the intended use is for such procedures? I think I'm right in saying that in other programming languages (e.g. Java) this isn't possible.

  • #2
    Maybe it's because of the past, where you could work with GOTO
    But you are right and maybe you could send a Request For Enhancements (RFE).

    Comment


    • #3
      I assume the compiler is not smart enough to trace all the posisble code paths and confirm that each ends with a return or a thrown exception

      Comment

      Working...
      X