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



Jon Paris wrote:

On 25-Feb-09, at 7:43 PM, rpg400-l-request@xxxxxxxxxxxx wrote:

I thought he was referring to the _called_ program at that point.
I'm not clear on how library qualification would make sense there.
What if I moved it to a different library and tried to call it?

I don't think it would help. Once a program pointer is resolved it remains usable - for example when a program is replaced the "old" version moves to QREPLOBJ and remains active. I suspect moving to another library would be the same.

Jon:

From the original:

In the caller :

D CallMyPgm PR EXTPGM ( gLibPgm )
D AParm LIKE ( gParm )

<snip>

In the called pgm :

D MAIN PR EXTPGM ( 'MYPGM' )
D AParm LIKE ( gParm )

I.e., there are two objects involved -- the calling program and the called program.

The question continued:

How do I get the 2 sources to use the same prototype declaration?
I can't put a variable in the place of 'MYPGM'.

That is, the EXTPGM() keyword in the /CALLed/ program was what the question seemed to be about. I agree that "it wouldn't help", but I was thinking that an explanation was called for.

As it turns out, it hasn't even made a difference in the simple tests I've done. I can put 'MYLIB/MYPGM' in, but compile it as [CRTBNDRPG YOURLIB/YOURPGM] and all that happens is that RNF3776 gets put into the listing, severity 10.

It is created as YOURLIB/YOURPGM.

If I use a variable, it fails with RNF3777. But if I use a constant with CONST('MYLIB/MYPGM'), it goes back to RNF3776.

In that sense, I suppose that the answer for David is to define gLibPgm as a constant rather than a variable in the /CALLed/ program. That would allow both caller and callee to use exactly the same prototype. It doesn't really seem to be very important what goes in there in the /CALLed/ program, as long as basic rules are followed.

No?

My question to you was about what the point would be for library-qualification in the /CALLed/ program for EXTPGM(). I wasn't at all clear on why you answered the way you did.

Hope I didn't just make things more confused...

Tom Liotta


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.