× 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 those of you who stuck to the subject of the issue at hand - thanks.
To those of you who decided to take the path of discussing naming
conventions all I can say is as a consultant we sometimes have little
choice regarding naming conventions or anything else. We simply adhere
to standards whether or not we agree with those standards. The client
pays the bills. If the client says to use qualified data structures and
begin every field with DS then that's what you do. We can attempt to
sway their decisions but in the end you do what the client wants. That
or your not employed for very long.   

Again, thanks to those who stuck to and helped resolve the issue. 

S. Ellsberry
steve.ellsberry@xxxxxxxxxxxx
 

-----Original Message-----
From: Ellsberry, Steve 
Sent: Wednesday, May 24, 2006 12:00 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Pointer / Based issue

Scott / Barbara
Thanks for the advice. Sometimes in an effort to make code more
efficient we overlook the obvious. 

We changed the procedure interface to pass the DS by reference and
exclude the pointer. We haven't got all the other kinks worked out yet
but we should be okay.
  
Again, Thanks. 

S. Ellsberry
(678) 893-6673
steve.ellsberry@xxxxxxxxxxxx
 

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Barbara Morris
Sent: Tuesday, May 23, 2006 9:41 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Pointer / Based issue

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

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.



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.