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



To elaborate on what Gene said, i. e.:


> RSLVDP will get the static variable value in another OPM invocation (if the
> variable had EXT scope).  

It took me a while to figure out "EXT Scope".  That is to say, you define any 
variables of interest in the "source program" (PROGRAM-A) as EXT variables, as:

DCL  DD  AN-EXTERNAL-VARIABLE  CHAR(1)  EXT;

This is like defining a variable in RPG as EXPORTed.  

Step (2) would be to execute the RSLVDP instruction in the program (PROGRAM-B) 
which is trying to inspect variables in PROGRAM-A, which gives you a resolved 
data pointer.  

Step (3) would be to set a based-on variable in PROGRAM-B to be based on the 
static storage in PROGRAM-A.  That way, PROGRAM-B can print that variable, or 
display it, or whatever.  Also you can CHANGE it in PROGRAM-B and it will be 
changed in PROGRAM-A as well.  

It doesn't work to base a variable on a data pointer.  You base the variable in 
PROGRAM-B on a space pointer, as usual, and then set that space pointer to the 
data pointer's value:

SetSppFp     Space-Pointer, Data-Pointer;

The based-on variable now has the value of the original variable in PROGRAM-A.  
You can also use the MATPTR instruction to "inspect" the resolved data pointer 
to see just what kind of variable it is that you are accessing (character, 
binary, etc.)

So ... is all this kefuffle worth it?  Oh well, at least we learned something!



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.