× 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: Call Backs
  • From: "Eric N. Wilson" <doulos1@xxxxxxxx>
  • Date: Thu, 4 Jan 2001 12:11:58 -0800
  • Organization: Doulos Software & Computer Services

Hello everyone,

I am trying to figure out if there is a way to implement call backs
with the EVAL/CALLP model rather than the CALLB model.

What I am trying to accomplish is basically a FOR EACH type of
function. Say I called the QUSLOBJ API to list the objects and I
wanted to simplify the use of this by allowing the programmer to
register a call back function that has to have a certain set of
parameters (eg. Library, Object, Object Type) and then within their
function they would do whatever they wanted with that object.

So they would call this function which I will call ForEach with the
PROCPTR of their function. Inside the ForEach function I would iterate
over all the instances of objects in the user space calling their
function for each one. I like the prototype calls for the obvious
reasons and would love to use them rather than CALLB...

The benefit of this approach is that you only have to code the stuff
that works with the user space once and then you can just concern
yourself with the logic that is pertinent to the problem at hand.

You can not say that a Procedure is Based upon a pointer :-( Most
likely because basing pointers are space pointers?)

I have looked and looked for the answer to this and of course I have
found every way to call a function that expects a call back (bsearch
for an example) but I have nothing that shows the equivalent of what
would be inside bsearch if you were to write it in RPG.

Thanks for your suggestions :-)

----------------------------------
Eric N. Wilson
President
Doulos Software and Computer Services


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