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



Steve,

Try changing the definition of the pointer in ErrorsInDS. 

        PointerPassedIn                            *    Const

By default the pointer is being passed by reference so the receiving
pointer is actually a pointer to a pointer, not a pointer to the DS.

HTH,

Rick

> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Ellsberry, Steve
> Sent: Tuesday, May 23, 2006 4:18 PM
> To: RPG programming on the AS400 / iSeries
> Subject: Pointer / Based issue
>
> I have a program that contains a data structure and a pointer defined
> as:
> 
> d FeatTypeDS                ds             Qualified
> d   dsFeat                                3     dim(1000)
> d   dsType                               2     dim(1000)
> 
> d    PointerToDS             s          *
> 
> I set the pointer by using:
> PointerToDS = %ADDR( FeatTypeDS )
> 
> I have a procedure called ErrorsInDS in a service program
> that accepts a pointer as a parameter and returns a Boolean.
> I get to the procedure by using...
> 
> If ErrorsInDS( PointerToDS );
> 
> 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)
> I'm trying to manipulate the data within the DS from my
> service program without duplicating the contents of the data
> structure and without actually passing the data. I figured
> the DS in the service program would be exactly as the DS in
> the calling program but it's not. The memory address leaving
> the program, PointerToDS, and entering the service program,
> PointerPassedIn, is exactly the same but the contents of the
> DS in the service program is not the same as the DS in the
> program. The program has valid data. The DS is the service
> program contains all asterisks.
> 
> Any ideas what I'm doing wrong?
> 
> 
> Thanks,
> S. Ellsberry

Privileged and Confidential.  This e-mail, and any attachments there to, is 
intended only for use by the addressee(s) named herein and may contain 
privileged or confidential information.  If you have received this e-mail in 
error, please notify me immediately by a return e-mail and delete this e-mail.  
You are hereby notified that any dissemination, distribution or copying of this 
e-mail and/or any attachments thereto, is strictly prohibited.


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.