|
-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Birgitta Hauser
Envoyé : vendredi 14 mai 2010 17:05
À : 'RPG programming on the IBM i / System i'
Objet : AW: Parameter prototype question
Hi David,
what do you think about using a field reference file and
define all your fields (parameter fields, work fields, file
fields ... etc) with like based on this reference?
That's the way we work. When changing a reference field
everything must be recompiled but we do not care about anything else.
The field reference file is included as external based data
structure (we are not yet on release 6.1 so we cannot use the
keyword TEMPLATE), in every RPG source member we use. All
Fields are refeneced:
Example
D/If not defined (FldRef)
D/Define FldRef
D FldRef E DS
ExtName('MYFLDREF') qualified
D Based(DummyPtr)
D/EndIf
D MyProc PR
D ParAAA Like(FldRef.AAA) Const
D POutCCC Like(FldRef.CCC)
D ParBBB Like(FldRef.BBB) Const
D Options(*NoPass)
D MyVarAAA S Like(FldRef.AAA)
D MyDS DS Qualified
D XXX Like(FldRef.XXX)
D YYY Like(FldRef.YYY)
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the
stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek
Bok) "What is worse than training your staff and losing them?
Not training them and keeping them!"
-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von David FOXWELL
Gesendet: Friday, 14. May 2010 16:31
An: RPG programming on the IBM i / System i
Betreff: RE: Parameter prototype question
-----Message d'origine-----pound bag and
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Simon Coulter
Pah! The compiler can't protect you from stupidity. The problem was
caused entirely by you trying to stuff 9 pounds in a 7
not expecting it to overflow i.e., not paying attention to what youwhere you might
were doing. Sure, without CONST or VALUE the compiler would have
caught the mismatch but consider the reverse situation
want to pass a smaller value or a different data type or a literal;
I don't need to consider the reverse situation here. Its just
a simple case as with most of our procedure calls of wanting
to pass a variable from one procedure to another and wanting
the compiler to check that for me. If you're saying that I
should have checke the attributs of each of the 20 or so
parameters myself then what's the point of having a compiler
that is capable of checking?
--
This is the RPG programming on the IBM i / System i
(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.
--
This is the RPG programming on the IBM i / System i
(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 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.