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



Hi Stefan -

On Wed, 8 Jul 2009 21:50:04 +0200, "Stefan Tageson"
<stefan.tageson@xxxxxxxxxxx> wrote:

Summary:

Based on the input I've got so far it seems that the main problem is the
need for the call of pgm B with many different parameter lists.

If I'm understanding the situation correctly, all of the program Bs
are not going to actually do anything with the information in the data
structure. They are just going to pass it along to the procedures in
service program C as a parameter.

That being said, you don't need to pass a pointer. As has already
been mentioned, parameters on dynamic program calls in RPG are already
using pointers. (So if you pass a pointer field, you are actually
passing a pointer to a pointer.)

In program A, use the data structure directly on calls to the program
Bs.

In all of the program Bs, define it as just a one byte character
field. Pass the one byte field on the procedure calls to service
program C.

In service program C, define a data structure idential to the one in
program A. Make it based on a pointer. Set the pointer to the
address of the one byte field.

Because under the covers it's actually a pointer being passed, and
because the pointer points to storage owned by program A, the whole
data structure is available in service program C. It doesn't matter
that only one byte is available to the program Bs.

If you change the data structure, including change its length, you
only need to change program A and service program C. None of the
program Bs need to be touched.

Another thought ... if the program Bs are going to call multiple
procedures in service program, and most/all of those procedures are
going to need the data in the data structure, you might want to
consider:

1. Making the data structure a global variable, based on a global
pointer field.
2. Creating a special procedure in service program C that would accept
the one byte character field and establish the pointer.

Then at the beginning of each program B, call the special procedure.
Doing this, you would not need to pass the one byte character on any
of the other procedures.

Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.

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.