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



And to clarify...

You can't use VALUE when defining the PR/PI for a program.

Charles


On Wed, Mar 11, 2020 at 3:21 PM Charles Wilt <charles.wilt@xxxxxxxxx> wrote:

On Wed, Mar 11, 2020 at 2:38 PM Nick <nicola.brion@xxxxxxxxxxxx> wrote:

Il 11/03/2020 18:03, dlclark@xxxxxxxxxxxxxxxx ha
scritto:
When you pass a parameter to a procedure, only its address is
actually passed -- unless the VALUE keyword is used on that parameter
description in the PR/PI.
In which case, the variabkle is copied to a new location and *pointer to
new location* is passed to procedure.

In the end, you always passed a pointer under covert....


That's not right... you're confusing CONST and VALUE...

With CONST, the data _may_ be copied to a new location and the address
passed via the call stack...

With VALUE, the data is passed directly on the call stack.

dcl-s v1 char(100)

dcl-pr proc1;
parm char(100)
end-pr;
dcl-pr proc2;
parm char(50) const
end-pr;
dcl-pr proc3;
parm char(150) const
end-pr;
dcl-pr proc4;
parm char(75) value
end-pr;

//16 byte address is passed stack
proc1(v1);
proc2(v1);

//data is v1 is copied to a new location
// and 16byte address is passed on stack
proc3(v1);

//75 bytes of the data in v1 is passed on stack
proc4(v1);

Charles


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.