|
John wrote: >Two questions; >1. >My understanding is if passed by Value and the procedure Does modify the >passed parameter >the Caller doesn't see the change. Is that correct? >Is it also correct for CONST ? I believe someone else answered this. You can change the value of a VALUE parameter within the procedure and the change will not be reflected in the caller's code. Indeed, since you can pass literals as VALUE parameters, changing the value of the passed parameter would not be a good idea. CONST parameters cannot be changed within the procedure. This rule is enforced by the compiler, even to the extent that you cannot save the address of a CONST parameter. (Note: As of V5R1, you can test if the %ADDR() of a CONST parameter is *NULL, but you just can't save that value.) >2. >Are you saying that in V5R1 my return variable can be defined >(LIKEDS) like an Externally Defined D/S ? Yes, you can define something LIKEDS an extdesc DS. > >So if I can now return (in essence) an Externally Defined D/S, >Can I get the Ext D/S covered in my DSPPGMREF command, can I huh ? >Can I ? Huh? It's on the "proposed enhancements" list. > >Can you make sure that both Caller/Callee use the same D/S definition? If a prototype definition includes something (parameter or return value) defined LIKEDS some data structure, the DS definition should be coded in the same /COPY member as the prototype. Thus, when that /COPY member is included in some source file, you know that both will be in synch. To indicate that the DS definition is a "template", define it as BASED(@). This is sort of like a "typedef" in C. Cheers! Hans Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.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.