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



That do able but if you still want the eval expression syntax you add RTNPARM to your procedure return parameter.

"The RTNPARM keyword specifies that the return value of a procedure is to be handled internally as a
parameter of the same type as the defined returned value, passed by reference."

-Matt

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Greg Wilburn
Sent: Friday, April 12, 2019 8:50 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Advice passing a large parameter

Thanks to both of you.

It would actually be easier to allow my procedure to change ONE value in the data structure (i.e. no CONST)... I wouldn't need to write it as a function that returned a separate value.

Greg

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of dlclark@xxxxxxxxxxxxxxxx
Sent: Friday, April 12, 2019 10:45 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Advice passing a large parameter

"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 04/12/2019
10:11:54 AM:
So my question is this: What is the best practice (most efficient)
for the Procedure Interface on my new procedure (function)?

Should I

1. Just define the DS the same and pass it in (it could be CONST)

2. Define only the fields I need (and hope I don't need any
additional in the future)

3. Define the PI as pointer and pass the address


Just pass your data structure name. RPG actually only passes a pointer in this case.

But, I wouldn't recommend using the CONST keyword. The manual says that using this keyword causes RPG to first copy the parameter value to another location in the caller's space and then passes a pointer to the copy. Thus, there would be additional overhead to copy large data areas to another location in memory. On return, the copy is simply discarded so that your original data structure is unchanged. If you really need your data structure to be protected from modification by the called process then, yes, use the CONST keyword.


Sincerely,

Dave Clark
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331




*********************************************************************************************
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary information. If you have received this message in error, please immediately notify the sender and delete and destroy the message and all copies. All unauthorized direct or indirect use or disclosure of this message is strictly prohibited. No right to confidentiality or privilege is waived or lost by any error in transmission.
*********************************************************************************************
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=_aOtv2UeeHIeg9tWAGMgeGgjT5jc0N-Wd3ku5rGj1W4&s=ow8g0B7oQkZjJk2juIMZ14T0bqNjbraOtXEIJ6JQatE&e=
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=_aOtv2UeeHIeg9tWAGMgeGgjT5jc0N-Wd3ku5rGj1W4&s=Bt0wdFFYMlyt3ImZ9SbTJ3vmAIAbrCswe-ri9Y7Pdcw&e=.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=_aOtv2UeeHIeg9tWAGMgeGgjT5jc0N-Wd3ku5rGj1W4&s=3292rR_tYwNBqRHgqiBovSLLI5k9wH06OEYWTJoDlAQ&e=
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=_aOtv2UeeHIeg9tWAGMgeGgjT5jc0N-Wd3ku5rGj1W4&s=ow8g0B7oQkZjJk2juIMZ14T0bqNjbraOtXEIJ6JQatE&e=
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=_aOtv2UeeHIeg9tWAGMgeGgjT5jc0N-Wd3ku5rGj1W4&s=Bt0wdFFYMlyt3ImZ9SbTJ3vmAIAbrCswe-ri9Y7Pdcw&e=.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=wgq2KO1Tl8HswJht2RKpmz7qvL2YDU_M-VhnRH6r43I&m=_aOtv2UeeHIeg9tWAGMgeGgjT5jc0N-Wd3ku5rGj1W4&s=3292rR_tYwNBqRHgqiBovSLLI5k9wH06OEYWTJoDlAQ&e=

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.