View previous topic :: View next topic
|
Author |
Message |
lakshmibala
New User
Joined: 16 Jun 2004 Posts: 47
|
|
|
|
Hi friends,
i have confusion in call by reference and content, which is default, plz tell me detail....?
regards
Lakshmi |
|
Back to top |
|
|
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
CALL BY REFERENCE is the default.
If the BY REFERENCE phrase is either specified or implied for a parameter,
the corresponding data item in the calling program occupies the same
storage area as the data item in the called program.
If the BY CONTENT phrase is specified or implied for a parameter, the
called program cannot change the value of this parameter as referenced in the CALL statement's USING phrase, though the called program can change the value of the data item referenced by the corresponding data-name in the called program's Procedure Division Division header. Changes to the parameter in the called program do not effect the corresponding argument in the calling program. |
|
Back to top |
|
|
veerababu
New User
Joined: 07 Nov 2004 Posts: 3
|
|
|
|
Hi,
Its very simple.....
If it is Call by content means the values are not reflected to the calling pgm.
If it is call by reference means the values are reflected to the calling pgm.
Defalult is call by refrence.
For eg u r in main pgm and u r sending the values(through CALL BY CONTENT) 10,20 to sub pgm and u modifed the values in sub pgm.When u come to the Main pgm the values r not reflected.
If it is in the case of CALL BY REFRENCE the values r reflected.
Thanks,
vb |
|
Back to top |
|
|
|