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



"Ellsberry, Steve" wrote:
> ...
> In the service program I have the procedure interface defined as
> p  ErrorsInDS                 pi                   n
>        PointerPassedIn                            *
> 
> I also have a data structure in the procedure defined as
> d FeatTypeDS                ds             Qualified
> Based(PointerPassedIn)
> d   dsFeat                                3     dim(1000)
> d   dsType                               2     dim(1000)
> ...
> The DS is the service program contains all
> asterisks.
> 

Steve, the problem you are seeing is due to a limitation of the
debugger.  It can't evaluate any variable that is based on a pointer
that is itself based. (A parameter passed by reference is considered
"based" on the address of the passed parameter.)

Good advice: Do what Scott suggested and code the procedure to pass the
data structure by reference instead of passing its address.

Bad advice: You _could_ solve the debug problem by copying the pointer
to a local pointer, and basing your data structure on the local
pointer.  Or by passing the parameter by value.


But in some cases it's unavoidable to have based-on-based situations. 
The RPG debugger uses the -> syntax to get around the problem:

  ===> EVAL PointerPassedIn->FeatTypeDS
or 
  ===> EVAL PointerPassedIn->dsFeat
  ===> EVAL PointerPassedIn->dsType

If the DS also had a pointer subfield dsPtr, and some other field say
fldx was based on that pointer, you could do
  ===> EVAL PointerPassedIn->dsPtr->fldx
etc.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.