|
Reader Feedback and Insights
Hey, Ted:
Good discussion on prototyping *entry parameters. As long as you're on the subject, though, there's one
thing that bugs me about prototypes, especially when used via a copy member.
Say program A calls procedure B, which is in a service program. Procedure B might be doing all of your
file access for you and its prototype is in a separate member that gets /copy'd in at compile time. The
field definitions in the prototype use the LIKE keyword to map to field definitions in the file(s) it's
using. Now program A copies the prototype member, but the file isn't defined in A, and so the LIKE
blows at compile time.
The only solutions I've come up with are to hard code the field characteristics, but that is really
terrible and defeats the whole concept of modern RPG programming, or create an external data structure
that refers back to the file containing the definitions, which I also find repugnant. OO concepts
suggest that I move file I/O to service programs and insulate my application code from file changes,
but then I turn around and put files back in the caller.
There's got to be a better way!
-- John
I understand, John. I've seen some methods to address this problem, but none that I liked or would
recommend.
-- Ted
|