‎2007 Jan 23 6:49 AM
Hi All,
What is the differents between Pass by value and Pass by reference with simple Examples. Thanks in Advance.
‎2007 Jan 23 7:12 AM
Hi vijay,
<b>Pass by reference:
A way of passing data from actual parameters to formal parameters. When you pass by reference, no local data object is specified for the actual parameter, but the procedure receives a reference to the actual parameter during call and works with the actual parameter itself. A change to the formal parameter in the subroutine also changes the value of the actual parameter.
Pass by value:
a local object with the same data type as the corresponding actual parameter is created in the subroutine and filled with its values. A change to the formal parameter in the subroutine does not change the value of the actual parameter. The actual parameter also retains its original value even after the subroutine has ended.</b>
‎2007 Jan 23 6:51 AM
‎2007 Jan 23 7:12 AM
Hi vijay,
<b>Pass by reference:
A way of passing data from actual parameters to formal parameters. When you pass by reference, no local data object is specified for the actual parameter, but the procedure receives a reference to the actual parameter during call and works with the actual parameter itself. A change to the formal parameter in the subroutine also changes the value of the actual parameter.
Pass by value:
a local object with the same data type as the corresponding actual parameter is created in the subroutine and filled with its values. A change to the formal parameter in the subroutine does not change the value of the actual parameter. The actual parameter also retains its original value even after the subroutine has ended.</b>
‎2007 Jan 23 7:16 AM
Hi,
Pass by reference:
A way of passing data from actual parameters to formal parameters. When you pass by reference, no local data object is specified for the actual parameter, but the procedure receives a reference to the actual parameter during call and works with the actual parameter itself. A change to the formal parameter in the subroutine also changes the value of the actual parameter.
Pass by value:
a local object with the same data type as the corresponding actual parameter is created in the subroutine and filled with its values. A change to the formal parameter in the subroutine does not change the value of the actual parameter. The actual parameter also retains its original value even after the subroutine has ended.
Examples:
Just have look at these links:
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db979d35c111d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/9f/db979d35c111d1829f0000e829fbfe/frameset.htm</a>
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db979035c111d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/9f/db979035c111d1829f0000e829fbfe/frameset.htm</a>
Regards,
Gunasree.