× 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 Thu, 14 Nov 2002, Joe Pluta wrote:

> > From: James Rich
> >
> > > the lack of bidirectional program parameters.
> >
> > Huh???  This has always existed.  Not identical to OS/400, but the ability
> > is certainly there.
>
> Not bidirectionally.

Oops!  I didn't see the "bidirectional" in there.  But my first example of
environment variables vs. the local data area is an example of
bidirectional parameter passing.

> <smile> I've written one or two C programs in my time, James.  I understand
> the concept of the main() methods and the argc/argv parameters.  The issue
> is bidirectionality - you can't modify those parameters and return values to
> the calling program.  This makes emulating a typical OS/400 application a
> bit tricky.

Yes, I'm sure you have.  I hope I wasn't being fecitious.  It isn't
strictly true that you can't return values to the calling program.  You
can return a value, but not multiple values (at least not when returning
from the main() function in C).

You are referring to the dynamic calls in RPG (at least I think you are),
i.e. the CALL opcode.  In C there is no real equivalent, certainly nothing
that can have multiple parameters that all get changed by the called
program (other than the environment variable example I already mentioned).
I won't argue with that.  However, it is interesting to note that more and
more people are switching to bound calls (i.e. CALLP) which are the same
as C's function calls.  Indeed, in my own programs I rarely use CALL at
all.  But I make extensive use of eval variable=function(parms).

The lack of RPG's dynamic CALL in C does not appear to me to be a
drawback (system() is not a functional equivalent).  Porting or
emulating an AS/400 RPG application in C has a lot larger hurdles than
that.  Of course using a different language might be different...

James Rich



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.