|
Rob, I use %parms a lot. yes, in answer to your question - if the last parm was passed, all were passed. The way I use it is pretty foolproof, assuming there is only one version of the program in use (with one copy of the source). The reason I use it is when I'm adding parms to an existing program to add functionality such as returning a value that wasn't returned before, change the functionality in some other way. consider this: Pgm A has 3 parms and is called from 20 different programs in the system. all work fine as designed. Now I'm writing Pgm B and I want to perform the exact functions Pgm A is designed for. But I also want it to pass me additional information that it wasn't originally designed for. I then change Pgm A to perform this extra step, and return the new value, but ONLY if %parms > 3. No need to change any other programs. Also, if someone is writing or changing another program, they might find an example of calling Pgm A, or they might even look at the source for Pgm A it doesn't matter, it will always work for what they need it for (passing 3 or 4 parms even if they pass 4 and never use the additional value) If you wish to add more functionality to the pgm, just repeat the steps above, and voila' - if %parms > 4 perform the new function (as well as the last function). No, not as slick or "new" as %addr but esentially serves the same purpose, and I think is more intuitive as to what is meant. Rick original message: Rob sez: >> %PARMS again? <snip> As far as I am concerned the only good use for %parms is if it is equal to the total number of parms available then you don't have to check each one individually. Or, does it assume that if you send the last parm then you sent all?-->> +--- | 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-2024 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.