|
Paul Morgan wrote: > ... > Why should I be prevented from passing a constant variable by reference to a > non-constant parameter? Yes it's bad. Give me a warning about it but don't > stop the compile. Not my fault the developer of that interface left off the > const keyword. I don't have control over the procedure definition. You're > making me have to 'fix up' the constant variable into a work variable > (another reason for using LIKE) just to call the procedure? > I think CONST is working correctly to stop the compile. (We do have a "pass by copy" parameter-passing-mode on our possible future enhancements list.) Defining the parameter-passing temporary LIKE the constant would only work if it was the same type as the prototyped parameter. I guess it would be a good practice to define every by-reference prototyped parameter LIKE or LIKEDS something, so that temporaries could be easily defined LIKE or LIKEDS the same thing. D myproc_types ds qualified D based(typedef_dummy) D myparm 10a D myproc pr D myparm like(myproc_types.myparm) ... D myparmTemp s like(myproc_types.myparm)
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.