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



Hello, David:

Passing these pointers as arguments ... but, pointers to what, exactly? Data structures? Why not just pass the data structures directly? If you pass a variable, or a data structure, etc. as a parameter, the default is that it will be passed "by reference" (which means the address of the variable or data structure is what is passed, anyway).
So, why go to all the trouble of adding another level of indirection, by passing a pointer, which contains the address of whatever it is that you really wanted to pass in the first place?

Also, what purpose or benefit does having this router program achieve? Why not just directly call these programs?

For one thing, you can then take advantage of various "impact analysis" tools to find out what programs call what other programs, or you can do a DSPPGMREF to an *OUTFILE and query the resulting table. By using this "router" program, you lose that information, and it will be much more difficult to find out "who calls what".

All the best,

Mark S. Waterbury

> David FOXWELL wrote:
Hi all,

I'd like some expert opinion here!

PgmA calls pgmB via a router with 2 obligatory parameters. The first, to tell the router what to do the second, an error message. :

Caller
Callp router( Info_Callee : ErrorMsg )

In addition, input parameters and/or output parameters can be passed via pointers :

Callp router( Info_Callee : ErrorMsg : ptr_in )
Callp router( Info_Callee : ErrorMsg : *omit : ptr_out )
Callp router( Info_Callee : ErrorMsg : ptr_in : ptr_out )

So there are 4 types of call possible.

The router will call the callee one of four ways like this, depending on the parameters received :
Callp callee ( ErrorMsg )
Callp callee ( ptr_in : ErrorMsg )
Callp callee ( ptr_out : ErrorMsg )
Callp callee ( ptr_in : ptr_out : ErrorMsg )

The callee does not control the passing of optional parameters, or the value *omit. This is done by the router.


The boss does not like it, and wants this :

Callp router( ptr_in : ptr_out )

The obligatory parameters would just be addressed by the pointers. No optional parameters. All programs call the router and are called with 2 pointers.


What do you think?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.