The calls are by reference only when the parameters exactly match the argument decalaration in the called proc. Else, it would become call by value.
i.e; In Call by value, if you send a value as a parm, the called proc uses it, processes it, but when its completed, the called proc sends back the original (sent) value. In Call by reference, the original value is replaced by the computed value (means, whatever changed in the called proc)
This is my understanding... Please advice if I am right....
Joined: 06 Jun 2008 Posts: 8165 Location: East Dubuque, Illinois, USA
Is it really that hard for you to click on the manuals link at the top of the page, find the PL/I Language Reference, and find:
6.8.1 Using BYVALUE and BYADDR
Unless an argument is passed BYVALUE, a reference to an argument, not its value, is generally passed to a subroutine or function. This is known as passing arguments by reference, or BYADDR. A reference to a parameter in a procedure is a reference to the corresponding argument. Any change to the value of a parameter is actually a change to the value of the corresponding argument. However, this is not always possible or desirable. Constants, for example, should not be altered by an invoked procedure. For arguments that should not change, a dummy argument containing the value of the original argument is passed. Any reference to the parameter then is a reference to the dummy argument and not to the original argument.
When you specify BYADDR, the compiler puts the address of the corresponding argument in the parameter list. When you specify BYVALUE, puts the value of the argument in the parameter list.
When you specify BYVALUE, a dummy argument is notcreated; however, as is also true for dummy arguments, any change to the corresponding parameter in the called routine will not be visible in the calling routine.
BYVALUE can be specified only for scalar arguments and parameters that have lengths and sizes known at compile time.
A BYVALUE argument should be one that could reasonably be passed in a register. Hence its type should be one of