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



On 2020-11-12 1:18 p.m., Brian Parkins wrote:
Here's a puzzle. Does anyone have a good explanation? I have a source member containing two procedures - the main (entry) procedure and a subprocedure (PROC2). The main procedure calls the subprocedure.
...
If I code this as a Linear Main program, PROC2 requires the EXPORT keyword, e.g.

**Free
Ctl-Opt DftActGrp(*No) ActGrp(*New) Main(Proc1);
Dcl-Proc Proc1;
// Main Entry procedure
  Dcl-PR Proc2;
  End-PR;
  Dsply 'In main Proc' '*REQUESTER';
  Proc2();
  Return;
End-Proc;
Dcl-Proc Proc2; // Edit: Brian's code had "Export"
// Internal subprocedure
  Dsply 'In Proc2' '*REQUESTER';
End-Proc;
...

Brian, as others have suggested, the problem is that the prototype for Proc2 is coded as a local prototype in your main procedure. RPG only recognizes a prototype as being the prototype for a local procedure when the prototype is in the global definitions of the module.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.