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



Typically you only want to include prototypes, named constants and occasionally
imported variables (and once in a while a generic "global" variable) in /COPY
members. Nothing else.
This is not a Natural Law or a compiler rule, however.
Declaring variables in /COPY's is usually only done to support Data Structure
templates. That is, you create a data structure named (for example) QUSEC_T and
that DS is used with LIKEDS(QUSEC_T) in your prototypes or local variable
declarations to create new, instances of the structures. Application-level
global variables are also found in /COPY's.
But other than that, prototypes and named constants are the majority of /COPY
code.

I think you techniques, while interesting, are far more complicated than they
need to be. Yes, perhaps they work, but that means nothing in coding today.
There are 1000 ways of doing everything and 998 of them are often not very
clear.

-Bob Cozzi
www.i5PodCast.com
Ask your manager to watch i5 TV


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of David Foxwell
Sent: Monday, May 07, 2007 8:32 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: ILE question : parmameters, modules and service programs

Thanks for all the help.

My problem now with service programs is that I don't see why I would put
exported procedures anywhere else!
If I create an exported procedure it's surely to be able to call it from
more than one program, so why have we been putting everything in modules?
Answers, please.

We DO have an application that recompiles all the necessary objects when a
module is modified. Trouble is, more and more programs are binding the same
procedures and the application seems to want to compile the whole machine
when one of our more popular modules is modified!

As for adding parameters, is this not a an idea ? :

Calling procedure
/COPY QRPGLESRC,DSPEC_P1

WPARM1 = IPARM1
WPARM2 = IPARM2

/COPY QRPGLESRC, CALL_P1

*************************************

QRPGLESRC/DSPEC_P1
D WPARM1 S LIKE(REF_PARM1)
D WPARM2 S LIKE(REF_PARM2)
*************************************

QRPGLESRC/CALL_P1
CALLP ( WPARM1 : WPARM2 )

*************************************

I haven't tried this, maybe someone will see a flaw right away and save me
some time.



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.