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



So your parameter list varies with each called program, but they all have to go through a common router. Is that the issue?

The purpose behind a prototype is to tell the compiler exactly which parameters will be passed and how they are used. A prototype where you don't define the parameters to be passed (because they're variable) would be pointless, as the compiler wouldn't be able to validate them.

If this is what you are struggling with, I'd consider a better design.


David FOXWELL wrote:

-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Scott Klement
In the example of Pgm A, if PgmId= Pgm C, how would you code that
program's prototype?

I don't understand where you are stuck. This seems like such
a simple thing...


Hi Scott,

Using Simon's example :

D ROUTER PR
D errMsg 1024 (as CONST OPTIONS(*VARSIZE) if input-only)
D PgmID 21 CONST OPTIONS(*VARSIZE)
D p1 ???? OPTIONS(*NOPASS : *OMIT)
D p2 ???? OPTIONS(*NOPASS : *OMIT)
D p3 ???? OPTIONS(*NOPASS : *OMIT)

I can see that I can code the prototype for Pgm C thus :

D ¨PgmC PR
D errMsg 1024 (as CONST OPTIONS(*VARSIZE) if input-only)
D PgmID 21 CONST OPTIONS(*VARSIZE)

Présuming it has no knowledge of the other parameters. In my OP, I hadn't thought of *nopass so I was wondering how to take care of the other parameters. If P1 was clientId for example, and PgmC did not use the parameter and had nothing to do with clients, I'd still have to define a parameter based on clientID.


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.