On 2019-03-21 6:55 PM, Charles Wilt wrote:
Sounds like you might have vMyPointer defined in twice, locally &
globally...

One is set, the other is not and you're passing the one not set.


There's an annoying "feature" of RPG where RPG will automatically define the basing pointer used in the BASED keyword, if the pointer is not already defined. At least, I find it annoying.

If you use the BASED keyword in a subprocedure and code a global pointer as the parameter, RPG will "helpfully" define the pointer locally. So even though you think you have only defined the pointer once, the compile listing will show that it is actually defined twice.

The most usual symptom of this is that when the based variable is used in the subprocedure, it fails due to pointer-not-set.

dcl-s p pointer;

dcl-proc;
dcl-s fld char(10) based(p); // causes P to be defined locally!
end-proc;


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-2020 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].