Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

pass by value

Former Member
0 Likes
741

can any one tell exact difference between pass by value and pass by referrence

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
718

Hi,

<b>Pass by Reference</b> With pass by reference, a reference to the actual parameter is passed to the method for each formal parameter for which an actual parameter is specified when you call the method, regardless of the parameter type. The method thus uses the actual parameter itself, and changes to formal parameters have a direct effect on the actual parameter.

<b>Pass by Value</b> With pass by value, a local data object is created as a copy of the actual parameter for each formal parameter when the method is called. In the case of input parameters and input/output parameters, the value of the actual parameter is assigned to this data object. The value of the formal parameter is only assigned to output parameters, input/output parameters, and return values if the method is exited without errors using ENDMETHOD or RETURN.

Reward if useful.

Regards,

Suruchi

4 REPLIES 4
Read only

Former Member
0 Likes
718

hi sandeep.

When u say pass by value u mean that u r using the actual parameters to pass the value directly.

when u say pass by reference u r using the ddress of this variable to store the value.

Read only

Former Member
0 Likes
718
Read only

Former Member
0 Likes
719

Hi,

<b>Pass by Reference</b> With pass by reference, a reference to the actual parameter is passed to the method for each formal parameter for which an actual parameter is specified when you call the method, regardless of the parameter type. The method thus uses the actual parameter itself, and changes to formal parameters have a direct effect on the actual parameter.

<b>Pass by Value</b> With pass by value, a local data object is created as a copy of the actual parameter for each formal parameter when the method is called. In the case of input parameters and input/output parameters, the value of the actual parameter is assigned to this data object. The value of the formal parameter is only assigned to output parameters, input/output parameters, and return values if the method is exited without errors using ENDMETHOD or RETURN.

Reward if useful.

Regards,

Suruchi

Read only

Former Member
0 Likes
718

Hi,

Pass By Value - This passes the actual parameters i.e variables passed to the Function Module.

Pass By Reference - This passes the address of the variable not the actual value.

Regards,

Priyanka.