× 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 Fri, 6 Dec 2002, Rich Duzenbury wrote:
>
> An OPM RPG program can only be in the call stack of a job one time.  If
> PGMA issues 'Call PGMA', an error ensues.
>
> I haven't tried to do so with ILE RPG, so I'm not sure, but I would expect
> the results to be similar.
>

Actually, in ILE you can have one copy of the program for each activation
group.   So, if the program is compiled with ACTGRP(*NEW), it can be
recursive.

That doesn't perform especially well, though.  You'd be better off using
a recursive subprocedure instead of calling the program recursively.

>
> ILE Procedures _can_ call themselves.  Similar to C, the arguments to the
> function call are pushed onto an internal stack, and then the function is
> given control.
>

Yep.  Absolutely.
But, I think the original poster was asking if a 'module' can call itself
recursively.  By that, I'm assuming he means: "can the main procedure of
an ILE RPG program call itself recursively?"

That's one that I don't have an answer for.   Maybe I should stop writing
e-mails, and try it. :)




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.