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

I wouldn't call my statement incorrect; simple perhaps but not
incorrect. ;-)

To be honest, the ability to dynamically active a bound program or
service program had slipped my mind, but I have heard of the capability.
But I've never needed to do use it.

Given the OP's prior posts, I'm not sure throwing out such an advanced
technique is a good thing.  On the flip side, maybe somebody who does
need it will find your answer in the archive.  In which case, let's
mention some API's:
        Activate Bound Program (QleActBndPgm) API
        Get Export (QleGetExp) API
        Activate Bound Program Long (QleActBndPgmLong)

Plus these puppies which I don't understand <grin>
        Activate Bound Program (ACTBPGM)
        Activate Program (ACTPG)
        Deactivate Program (DEACTPG)

Lastly, just to be nit-picky...

The OP asked:
> I have created an RPG ILE Program which contains multiple functions,
just
> like a function library.
>
> Now I want to call Function 2 from another RPG Program with :
> Call 'myLibrary'
> Parm ????
>
> But I don't know how to mention, what function I am calling ?

The only correct answer is indeed, "You can't do it that way."  For the
simple reason that with the functions in a service program or using the
advance techniques you mentioned, you'd need to use CALLP or CALLB
instead of CALL.



Charles Wilt
--
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121
  

> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx 
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
> Sent: Tuesday, May 09, 2006 11:12 AM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: RE: Calling a Function from RPG Program having 
> multiple Functions
> 
>  >> You can't do it that way.
> 
>  >> You need to place your functions into a service program. 
> 
> I agree that for most cases a Service program is the way to 
> go - after all
> that is what they were designed for.
> 
> However, your basic "You can't do it ..." statement is 
> incorrect.  I can and
> have done it several times.  In fact it is not even necessary 
> to bind the
> modules - you can treat _any_ PGM object as a service program 
> if you wish.
> 
> The basic requirement is that you have a means to call the PGM and it
> responds by supplying one or more procedure pointers to its internal
> procedures.  You then make subsequent calls via those 
> procedure pointers.
> 
> We have used the technique a number of times to get the effect of a
> dynamically loaded "service program" - it also allows for 
> semi) dynamic
> swapping of the "service program".  Not that there are APIs 
> for dynamically
> resolving the procedures in a Service Program, this is not 
> needed as often,
> but it has its uses.
> 
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.