Application Development 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: 

call by value

Former Member
0 Kudos

Hi all,

please give one example about

1.call-by-value

2.call-by-reference.

3.By using both

3 REPLIES 3

Former Member
0 Kudos

data : a type i.

a = 10.

write 😕 a.

perform call_by_value changing a.

write 😕 a.

perform call_by_ref using a.

write 😕 a.

&----


*& Form call_by_value

&----


  • text

----


  • -->P_A text

----


form call_by_value using value(a) .

a = a + 10.

endform. " call_by_value

&----


*& Form call_by_ref

&----


  • text

----


  • -->P_A text

----


form call_by_ref using a.

a = a + 10.

endform. " call_by_ref

Former Member

Former Member
0 Kudos

data : a type i, b type i.

a = 10.

b = 20.

write 😕 a.

perform call_by_value changing a.

write 😕 a.

perform call_by_ref using a.

write 😕 a.

perform call_by_val_ref changing a b.

write 😕 a , b.

&----


*& Form call_by_value

&----


  • text

----


  • -->P_A text

----


form call_by_value using value(a) .

a = a + 10.

endform. " call_by_value

&----


*& Form call_by_ref

&----


  • text

----


  • -->P_A text

----


form call_by_ref using a.

a = a + 10.

endform. " call_by_ref

&----


*& Form call_by_val_ref

&----


  • text

----


  • <--P_A text

  • <--P_B text

----


form call_by_val_ref changing a

value(b).

a = a + 10.

b = b + 10.

endform. " call_by_val_ref

Regards

Vasu