|
C *in06 ifeq *on - why not get rid of the ifeq (shudder) this is fine C If *In06 - or this if you have to code the *On C If *In06 = *on Now on to your question <grin> >> From a technical viewpoint, are these two chuncks of code equivalent? Or, >> is the RPG IV code a bound call of some sort? Yes they are. The underlying call is identical in both cases. >> Plus, if they are equivalent, what is the advantage of the RPG IV code (if any)? Many advantages. First you get rid of the ugly non-intuitive CALL/PARM. Second the use of the CONST keyword allows you to use (for example) an integer value for the second parameter. Suppose you had the command string in a variable called CommandString. The following would be fine. C CallP RunCmd(CommandString: %Len(%TrimR(CommandString))) In other words the use of a prototype can save you from having to match the exact type and length of a parameter. The compiler will generate the additional logic to match the parameters. Third, and perhaps most important, by using a prototype you ensure that you don't ever screw up and issue a call with only two parameters when three were needed. +--- | 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.