|
>> After 20+ years of RPG coding, I learned something just last week from Mike Cravitz that I had never seen in any other example code before. That was the ability to stick constants (the D-specs) right in the middle of procedure parameters or ds specifications. Well this used to work in DSs with RPG/400 - but it doesn't (or shouldn't) work with RPG IV. Maybe Barbara can comment, but this seems to be a compiler bug. This is what the manual says: "Definitions of data structures, prototypes, and procedure interfaces end with the first definition specification with non-blanks in positions 24-25, or with the first specification that is not a definition specification." I just did a quick check using the CODE verifier for V5R2 and sure enough a constant in the middle of a DS does indeed "work". I say "work" because although the Ds is sized correctly (which surprised me) the constant appears from the xref to be handled correctly - however - any attempt to reference it results in a "not defined" error. In other words it works as long as you don't use the constant! To my mind it _should_ issue a "subfield not in DS" error for the first field after the const. Jon Paris Partner400
This mailing list archive is Copyright 1997-2026 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.