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



I agree with David’s assessment. By default, RPG passes parameters by reference, meaning that a pointer is passed from the caller’s scope, so that the called program can access the callers storage directly.

The size and format of the address space is agreed upon by both parties. Since no data is actually being moved, the size of the parameter data is irrelevant to the performance question.

Passing by value is the expensive option you should try to avoid. This also includes large “return values” which are also passed by value. IBM gave us RTNPARM option to resolve that issue, but it’s not the default behavior, so just be aware.

Passing with CONST option performs well despite some small overhead with initialization of constant value storage in caller.

-Eric DeLong

On Apr 12, 2019, at 9:18 AM, David Gibbs via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx> wrote:

CAUTION: EXTERNAL EMAIL

**********************************************************************
On 4/12/2019 9:11 AM, Greg Wilburn wrote:
1. Just define the DS the same and pass it in (it could be
CONST)

I'm pretty sure this is the best way to do it. If you define the parm as const, I'm pretty sure it will be passed by reference, so there will be no additional storage allocated.

3. Define the PI as pointer and pass the address

No need to do this, as mentioned above, that's essentially what's already happening.

david



--
IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding 615 miles (Yes, you read that right) in the American Diabetes Association's Tour de Cure to raise money for diabetes research, education, advocacy, and awareness. You can make a tax-deductible donation to my ride by visiting https://urldefense.proofpoint.com/v2/url?u=https-3A__mideml.diabetessucks.net&d=DwICAg&c=kUT9u1ftLjMzSSPm_-knDdNvxOshAnRL8kekFKxW3Wg&r=9Ntyfp-OuZH8yZaiXsb9HlYdW65WTi1eFGJS7ZM5Mok&m=qdWt_AwJqKEXpF4tkqKNpvVqMO67NeiQIF-PRnfw3W4&s=PtvmWvRmSkKH7OarkWfUjwuxfsYtFQC-TuK8DCrd8mo&e=.

You can see where my donations come from by visiting my interactive donation map ... https://urldefense.proofpoint.com/v2/url?u=https-3A__mideml.diabetessucks.net_map&d=DwICAg&c=kUT9u1ftLjMzSSPm_-knDdNvxOshAnRL8kekFKxW3Wg&r=9Ntyfp-OuZH8yZaiXsb9HlYdW65WTi1eFGJS7ZM5Mok&m=qdWt_AwJqKEXpF4tkqKNpvVqMO67NeiQIF-PRnfw3W4&s=vxe2O14Mytl8MzURE3Px_G_JrPY7KDABI2UaQksT_Js&e= (it's a geeky thing).

I may have diabetes, but diabetes doesn't have me!
--
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=kUT9u1ftLjMzSSPm_-knDdNvxOshAnRL8kekFKxW3Wg&r=9Ntyfp-OuZH8yZaiXsb9HlYdW65WTi1eFGJS7ZM5Mok&m=qdWt_AwJqKEXpF4tkqKNpvVqMO67NeiQIF-PRnfw3W4&s=OEYx8_Zrit5YsQO4808wAYmIlTaf4C_dtwkWZ_Rk26M&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=kUT9u1ftLjMzSSPm_-knDdNvxOshAnRL8kekFKxW3Wg&r=9Ntyfp-OuZH8yZaiXsb9HlYdW65WTi1eFGJS7ZM5Mok&m=qdWt_AwJqKEXpF4tkqKNpvVqMO67NeiQIF-PRnfw3W4&s=uL7_DXV22_KMdPRw7QEmXXhgyEc5C33CWeQr450yU0w&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=kUT9u1ftLjMzSSPm_-knDdNvxOshAnRL8kekFKxW3Wg&r=9Ntyfp-OuZH8yZaiXsb9HlYdW65WTi1eFGJS7ZM5Mok&m=qdWt_AwJqKEXpF4tkqKNpvVqMO67NeiQIF-PRnfw3W4&s=AFxaH8apUaQvKybYCRgRXX4nPnjWMb5MKqMjlJt55Vs&e=

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.