Guild Companies, Inc.  
 
Midrange Guru - Tech Tips
OS/400 Edition
Volume 2, Number 7 - January 30, 2002

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

Sponsored By
WORKSRIGHT SOFTWARE, INC.

Indiana and Arkansas have new area codes! How are you going to update your customer files?

We have the answer. Our ZIP/CITY System for the AS/400 can automatically update your customer files for this area code split and future ones as well.

Visit our Web site www.worksright.com to learn more about ZIP/CITY. We offer a free, no-hassle, 30-day trial. Phone, fax, e-mail us, or order your free trial directly from our Web site.

THIS ISSUE
SPONSORED BY:
WorksRight Software
LANSA
BACK ISSUES
TABLE OF CONTENTS
Journaling Changed
Bytes Only
Retrieve a Spool File
Number
Reader Feedback and Insights
  Newsletters | Subscribe | Advertise | About Us | Contact | Search | Home  
  Last Updated: 1/30/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.