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


  • Subject: RE: OO in RPG (APIs for the gentleman)
  • From: Peter Connell <peterc@xxxxxxxxxxxxx>
  • Date: Wed, 6 Dec 2000 14:53:02 +1300

Jon,
This is an excellent notion. I had a feeling you would oblige with a
contribution since you appear to have a good grasp of the language
environment.
There is a News/400 article from July 1997 titled
"AS/400 DLLs In-Depth: Fast and Flexible Dynamic Calls" 
by Scott N Gerard. The url directly to the article is
http://www.as400network.com/artarchive/index.cfm?fuseaction=viewarticle&CO_C
ontentID=1990&OCFI=1006555&OCFT=60297314

The technique is to resolve a ponter to a service program at runtime then
use the system QleActBndPgm API that allows you to activate a service
program at runtime.

Cheers, Peter

-----Original Message-----
From: Jon.Paris@hal.it [mailto:Jon.Paris@hal.it]
Sent: Wednesday, December 06, 2000 5:33 AM
To: RPG400-L@midrange.com
Subject: RE: OO in RPG



 >> To obtain a truly dynamic procedure call that is not known at compile
time
you must you the special API's that permit you to force the activation of a
service pgm and provide access to the procedures within.

Hi Peter,

one qualification and one question.

While it is true that the addresses must be known at compile time, it is
_which_ program's compile time that is the issue.  For example, I can
create a dynamically called program which establishes procedure pointers
for all of the procedures it wishes to make available to the outside world.

This program has a mainline whose only purpose is to return to its caller
an array of procedure pointers and their names.  This program can be
dynamically called during the initialization phase.  Subsequently the
procedure pointers are used to call the subprocedures in the "program".

By doing it this way the only program that needs to know the procedure
addresses at compile time is the one that contains them - not exactly an
arduous limitation!!  The other benefit is that the program itself is
dynamically called to provide the pointers in the first place and because
it is a dynamic call it can be called by variable name. Since it is only
ever called once during the currency of the application, the performance of
such a call is not an issue - of course it mustn't return with LR on
<grin>.

As you can see considerable flexibility can be gained without the need to
resort to the APIs.

That brings me to my question.  Which are the APIs involved?  I tried to
find them the other day to answer a question from a "gentleman" on one of
the lists who insisted that I was lying when I said it could be done.
Because he'd been so darn rude I didn't put a lot of work into it, but I
know they exist.  Can you help me out with the names?

Thanks muchly


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---

This communication is confidential and may be legally privileged. 
If it is not addressed to you, you are on notice of its status. 
Please immediately contact us at our cost and destroy it.  
Please do not use, disclose, copy, distribute or retain any of it 
without our authority - to do so could be a breach of confidence. 
Thank you for your co-operation.  
Please contact us on (09) 356 5800 if you need assistance.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.