× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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 thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.