|
Can someone please explain why the repetition between the prototype and procedure interface? The ILE RPG manual has the following definitions: "A prototype is a definition of the call interface." "A procedure interface definition is a repeat of the prototype information within the definition of a procedure." Why all the repetition? Assuming there's a reason, then I suppose IBM's recommendation for using COPY's is a good one, although I have not used those for years because they tended to make it difficult to find a statement number in source code from the one given in an error message, a problem which cropped again when I started using ILE RPG. In most cases now it is necessary to use STRDBG to find the actual statement in the source code given a statement# in an error message. Also, aren't external definitions preferable? As in: D* First the prototype Dprogramname pr DTrailer LIKE(BSXTRL) DSCACCode LIKE(SCACCode) D* Now the procedure interface Dprogramname pi DTrailer LIKE(BSXTRL) DSCACCode LIKE(SCACCode) Regards, Peter ----- Original Message ----- From: Joel Fritz <JFritz@sharperimage.com> To: <RPG400-L@midrange.com> Sent: Friday, September 24, 1999 10:28 AM Subject: RE: RPG IV program - comments requested > Only one suggestion and it's what I would think of as a style issue: > > You might want to use a prototype and procedure interface in place of the > *entry plist. This will allow type checking of the parameters at compile > time if you're calling it with callp() from another RPG program. It's also > the thin edge of the wedge for learning procedures and service programs. > Here's an example: > D* First the prototype > Dprogramname pr > DTrailer 10A > DSCACCode 4A > D* Now the procedure interface > Dprogramname pi > DTrailer 10A > DSCACCode 4A > > Put them at the beginning of the D specs and eliminate the stand alone > definitions of trailer and scaccode. You could leave the variable names > blank in the prototype since all the compiler cares about is the data type > and length, but the names matter in the procedure interface because you are > defining the variables for your program there. > > > -----Original Message----- > > From: Jim Langston [mailto:jlangston@conexfreight.com] > > Sent: Friday, September 24, 1999 8:39 AM > > To: RPG400-L@midrange.com > > Subject: RPG IV program - comments requested > > > > > > This is a small update utility I just created for one of my > > users. All > > it does is > > goes through a file and changes one field (BSSCAC) when > > another filed is > > > > equal to an input value (BSXTRL). > > > > There are two input parameters, Trailer and SCACCode. Trailer is the > > search > > criteria. > > > > I would request critiquing of this program. That is, I am > > using D specs > > to declare > > my variables, I am using a PLIST to declare my entry > > parameters and I am > > using > > the RPG Cycle to cycle through all my records. > > > > Since I am just starting to program in RPGLE I do not want to get any > > bad habits > > started now. I would rather start of on the right foot. > > > > So I guess I am asking, if you were to write this same > > program, is this > > the way you > > would code it? > > > > Regards, > > > > Jim Langston > > > > FBSSHIPX UP E DISK > > > > DTrailer S 10A > > DSCACCode S 4A > > > > C IF Trailer = BSXTRL > > C EVAL BSSCAC = SCACCode > > C UPDATE BSSHIPX1 > > C ENDIF > > > > ******************************* > > *** Set up Entry Parameters *** > > ******************************* > > C *INZSR BEGSR > > C > > C *ENTRY PLIST > > C PARM Trailer > > C PARM SCACCode > > C > > C ENDSR > > > > > > +--- > > | This is the RPG/400 Mailing List! > > | To submit a new message, send your mail to RPG400-L@midrange.com. > > | To subscribe to this list send email to RPG400-L-SUB@midrange.com. > > | To unsubscribe from this list send email to > > RPG400-L-UNSUB@midrange.com. > > | Questions should be directed to the list owner/operator: > > david@midrange.com > > +--- > > > +--- > | This is the RPG/400 Mailing List! > | To submit a new message, send your mail to RPG400-L@midrange.com. > | To subscribe to this list send email to RPG400-L-SUB@midrange.com. > | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.