Monica, If you don’t know what %Addr does or its use, keep using what you're familiar with

Your code is valid even if it's done the old fashion way.
Only thing missing is a END-DS at the end of DCL-DS


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Mónica Anastácio
Sent: Wednesday, March 11, 2020 12:56
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: external data structure in free rpgle cant be use in DCL-PI ?

You're right, I don't understand



Why are u doing this?
* per5005ds = %addr(i_er5005ds); *

On Wed, Mar 11, 2020 at 4:03 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

Monica - what do you mean "forcing information to pass".

The only thing that passes anywhere is the pointer to the original DS
passed on the call.

From there on copy of the definition is BASED on that pointer to
allow access to the _original_ data. No data is moved - it stays in
the original calling program as it does with the fixed form method.

I think you may be misunderstanding how parameters work.



On Mar 11, 2020, at 11:11 AM, Mónica Anastácio <
monicaanastacio@xxxxxxxxx> wrote:

The solution with pointer from Joe end up being exactly the same ,
forcing
information to pass from one side to another, and that’s what I
want to avoid Maybe theres no other way of using a external DS like
parm entry in FREE.

DCL-DS waapids_orig extname('FR5005DS') inz;

-----------------------------
--------------------------------------------------------

DCL-PI *N;

p_waapids like(waapids_orig);

END-PI;

----------- --------------------------------------------------------
begsr $pcpgm;

* waapids_orig = p_waapids; *
endsr
--------------------------------------------------------------------
begsr $ucpgm;

* p_waapids = waapids_orig; *
return;
endsr;



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.