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



lol...

IMHO, part of what a company is paying a consultant for is expertise...

At the very least, you should be pushing for a modification of the /COPY
prohibition to specify that C-SPECS shouldn't be copied in as a general
rule. But that D-specs are ok.

My guess the rule was originally written for RPGIII. It doesn't makes
sense for RPGIV and in fact goes against every RPGIV best practice I've
ever seen.

Heck, you should probably have a standard disclaimer you require shops to
sign when they force you to do something dumb. Perhaps that will help. :)

Charles


On Wed, Jun 26, 2013 at 8:49 AM, <j.beckeringh@xxxxxxxxxxxxxxxxxxxxxxxxxx>wrote:

(I do come across installations
where standards expressly forbid the use of /COPY - hence another appeal
of
the V7.1 enhancements.)

Those standards are probably old enough not to know about /INCLUDE, so,
while your splitting hairs anyway, you should be able to get away with
using /INCLUDE :-)

Joep Beckeringh


rpg400-l-bounces@xxxxxxxxxxxx wrote on 26-06-2013 12:45:33:

Brian Parkins


Barbara, thank you for clearly outlining "best practice" for coding
PR/PI to
replace the old-style *ENTRY PLIST.

The (RPG Reference) Manual confused me somewhat. In the V7.1 "What's
New" section it states:
"Optional prototypes
If a program or procedure is not called by another RPG module, it is
optional to specify the prototype. The prototype may be omitted for the
following types of programs and procedures:
- A program that is only intended to be used as an exit program or as
the
command-processing program for a command
- A program that is only intended to be called from a different
programming
language <<<<<
- A procedure that is not exported from the module
- A procedure that is exported from the module but only intended to be
called from a different programming language"

The above text suggests Program A cannot call Program B if both programs
are
written in RPG _and_ Program B has no prototype defined within the
module.
This has never made sense to me. But perhaps I am misinterpreting?

The following example works perfectly well - now that we can specify
EXTPGM
on the PI in Program B. Yet the code appears to contradict the Manual.
========================================
// Module/program name is PROGRAMA
D CallParms Pr ExtPgm('PROGRAMB')
D 10A Const
D String S 10A Inz('String 8')
/Free
CallP CallParms(String);
*InLR = *On;
/End-Free
========================================
// Module/program name is PROGRAMB
// No Prototype (PR)
D EntryPlist Pi ExtPgm('PROGRAMB')
D String 10A Const
/Free
Dsply String '*REQUESTER';
*InLR = *On;
/End-Free
========================================
PLEASE NOTE: I am _not_ suggesting the above example is good practice! I

appreciate it would be far wiser to code the prototype in a separate
source
member and /COPY in both of the above programs.

I know I am "splitting hairs" and probably wearing out my welcome. The
reason I am trying to nail down the semantics is because the above
example
is an easier starting point from which to teach the use of PI/PR to
students
familiar with the old PLIST way of doing things. (Duplicating the PR is

both Caller and Called programs does not make a good impression at first

look.)

I agree wholeheartedly that using /COPY to embed the PR in both programs
is
desirable for building more robust code. (I do come across installations

where standards expressly forbid the use of /COPY - hence another appeal
of
the V7.1 enhancements.)

Thanks again for everyone's patience!
Brian Parkins.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.