|
I think you pretty much got it. The only thing that I see that could cause problem in the future is the hard coding of field length in the prototype. In my copy book, I normally have the following to avoid hard code field length (Assuming that REFMAST file is the master reference file): /If Not Defined(Copy_REFMAST) D refREFMAST E DS prefix(ref) extname(REFMAST) based(pRefMast) /Define Copy_REFMAST /Endif This way you can do this in you prototype D GetGroup PR 1A EXTPROC('GETGROUP') D $Group like(refGroup) D $Cust# like(refCust#) CONST OPTIONS(*OMIT) D $Item# like(refItem#) OPTIONS(*NOPASS) As far as multiple/single sub-procedures in a single source member, this has been debated on before. Might want to search the archive. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Ala, Michael A Sent: Tuesday, February 01, 2005 12:28 PM To: rpg400-l@xxxxxxxxxxxx Subject: Prototyped Procedures What is the best way to perform Procedure prototyping I would like some rules I am not sure if I am performing any steps that are unecessary This is in the caller D/COPY MYLIB/QCPYSRC,GETGRP_PR This is what is copied in D GetGroup PR 1A EXTPROC('GETGROUP') D $Group 10A D $Cust# 8S 0 CONST OPTIONS(*OMIT) D $Item# 25A OPTIONS(*NOPASS) Here is the call for the Procedure (um Function) EVAL $CustGrp=GETGROUP($Group:CUST#) Here is what is in the called Procedure D/COPY MYLIB/QCPYSRC,GETGRP_PR PGETGROUP B EXPORT D GetGroup PI 1A D $Group 10A D $Cust# 8S 0 CONST OPTIONS(*OMIT) D $Item# 25A OPTIONS(*NOPASS) D $Found S 1A INZ('N') Also what are the advantages to setting up multiple sub-procedures in a single source member What limitations does this have I am always doing things I can't do; that's how I get to do them. -Pablo Picasso -- This is the RPG programming on the AS400 / iSeries (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-2025 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.