|
>> I just kept my example simple which I shouldn't have done. Sorry for the confusion No problem - normally I'm begging people to just keep it simple! >> What I am working on understanding now is the merits between passing the pointer to the subprocedure versus returning the pointer to the calling subprocedure. For that matter, what are the merits of using a return argument at all? From my perspective a return value is preferable for two main reasons: First when the result of the proc is usable directly in a calculation. In your case that is not likely. The second reason is to make it obvious just _what_ is being changed by the subproc. Just safer that way - you know you don't have to chase down the subproc logic just to see if it could have changed one of the parms. In your case I think I might go with Hans' suggestion in that having the storage in the subproc doesn't permit you to invoke the routine twice. That may not seem important now but one day ..... Even then I might still have it return the whole DS if it is not too huge. Depends on my mood and the direction of the wind! +--- | 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.