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



Joe Pluta wrote:
We'd have to ask someone more knowledgeable about the compiler to see if the
following idea is safe, but you MIGHT be able to take the address of the
return value and compare it to NULL. If it's null, don't set the return
value.

It's not perfect, but if it's safe, it beats the double maintenance of a
wrapper stub.

I have been able to corrupt storage I don't own by doing something similar.

CALL SOMEPGM /* no parms on call by accident */

SOMEPGM:
*entry plist
parm returnCode
eval returnCode = *blanks

This code has run without getting a MCH3601. Sometimes there's a pointer in just the right spot in memory and BLAM!

Never done that with a function/subprocedure call because RPG lets me discard the return value (callp someProc vs eval return = someProc). Apparently the database manager isn't so forgiving. It would be an interesting test to see if one *always* got a NULL from the database manager.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.