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



oh. I forgot to mention ... you type even less WITH LONG procedure/variable names.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Schmidt, Mihael
Sent: Wednesday, May 19, 2010 4:23 PM
To: RPG programming on the IBM i / System i
Subject: RE: [SPAM 1]procedure parameter names

Yes, others tend to disagree. Take an editor that supports content assist/auto completion and you end up typing even less => be more productive.

Mihael

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Rory Hewitt
Sent: Wednesday, May 19, 2010 3:58 PM
To: RPG programming on the IBM i / System i
Subject: Re: [SPAM 1]procedure parameter names

David,

It's a boolean situations: If these are standards that you *can't* change,
then as you say, you have to live with it. If these are standards that you *
can* change, then just change them. I'm not sure what you're asking us...

Quick suggestion - use the A or An prefix for stand-alone fields and
data-structures, but not for data-structure subfields. That way at least,
you would get 'AMonPrcNomIn.ElpNm', so you'd have statements like (to use
your example):

AnElpNm = AMonPrcNomIn.ElpNm;

Personally, I still tend to use (up to 3) combinations of 3-character
multiples for variable names, e.g. RtnVal, RtnDtaLen, ElmNbr etc. Very
comprehensible (IMNSHO) and easier to write than ReturnValue,
ReturnDataLength, ElementNumber. But that's because I still use SEU and I
don't like to extend expressions over multiple lines where possible. Others
may (will!) disagree.

Rory

p.s. "What a cop out. I was counting on you, Simon."... Do you *really* want
Simon to stamp all over your code/feelings? Because he will! Those Aussies,
y'know - very blunt :)

On Wed, May 19, 2010 at 12:18 AM, David FOXWELL <David.FOXWELL@xxxxxxxxx>wrote:

Hi,

We're relooking at the naming conventions we are using for parameters in
procedures.

RPG III was simple, with 6 character field names we had two syllables of 3
characters followed by 2 characters and a prefix I or O.

Then, when RPGIV came, we kept the 6 character field names but the prefix A
was used for input and output. If the parameter name began with a vowel, the
suffix is An. Nobody knows why.
Eg Elephant Name would have been IELPNM. Now it would be AnElpNm.

Furthur imposed, is the use of 2 data structures for the parameters.

So, we now have, for the procedure MonPrcNom (mon procédure nom !)

D MonPrcNom PR N
D AMonPrcNomIn LIKEDS (MonPrcNomInDs) CONST
D AMonPrcNomOut LIKEDS (MonPrcNomOutDs)

In the definition of the DS you find the actual parameter names eg,
D MonPrcNomInDs DS TEMPLATE QUALIFIED
D AnElpNm LIKE(DFN_ELPNM)

Note that the prefix A or An is now in 2 places, because the actual
parameter name is AMonPrcNomIn.AnElpNm. Somewhere in there is the elephant's
name!

Any thoughts?
Thanks.


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.