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



A call to a program created with CRTPGM is still a call to a program - sorry for taking a piercing glance at the obvious.

And one can and perhaps should use prototype and interface for the main procedure - as well as any subprocedures. Hence the discussion of PLIST - where you cannot do anything with CONST or VALUE. There is a message - look for my earlier post to see the ID - that says that VALUE cannot be used in a main procedure.

Guy Vig and I were discussing this kind of thing once - and he reminded me that all program calls are by reference - we have rehashed this here. So, yes, C programs would be the same, having their main() function. C functions, OTOH, are in service programs, and are procedures in the parlance of RPG.

So I was talking about C functions - that was not programs.

Again, see my earlier post in this thread where I showed examples of CONST and VALUE in the main procedure. HEH - the concept of main procedure comes from somewhere - let me see - where would that be?

Regards
Vern

Larry Ducie wrote:
Hi Vern,
<snip>
Do I remember right? The C/C++ functions are all procedures? I think they are all in a service program or 2.
</snip>
I would imagine that in ILE every call is to a procedure.
The difference is encountered when a dynamic call is made to a program. In RPG the parameters are passed to the PEP. I believe these parameters are in the form of an array of pointers. The PEP then does some fancy footwork to ensure the variables passed go the appropriate module main procedure.
The first call (to the PEP) is dynamic but the second call (to the main procedure) is bound.
I would imagine the same would occur if the program was created from a C module. I can't imagine a program created from a C module would have a different call mechanism to a program created from a RPG module. What happens internally (between the PEP and the main procedure) may differ but the external call to the program should be identical. Otherwise we would have to cater for all kinds of incompatibilites when calling across language boundaries. I would imagine passing options such as *CWIDEN and *CL are used when preparing the parameters for the bound call and do not relate to external calls.
Hmmm...
Just thought - was you specifically talking about calling the runtime library functions via a prototyped call and not calling a program via an external call as my post focused on? If so then yes, they are bound calls - the prototype will have extproc defined and you will need to include the QC2LE binding directory to locate the service programs.
Cheers
Larry Ducie
_________________________________________________________________
It's simple! Sell your car for just $50
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.