Page 1 of 1

CALL by reference and content.

Posted: Thu Mar 27, 2014 6:26 pm
by Raunak Singh
I'm confused in call by reference and content, which one is default. Can you please explain?

Regards

Re: CALL by reference and content.

Posted: Thu Mar 27, 2014 6:58 pm
by Robert Sample
From the Language Reference manual section on the CALL statement:
BY REFERENCE is assumed if you do not specify a BY CONTENT, BY REFERENCE, or BY VALUE phrase prior to the first parameter.
CALL BY REFERENCE passes the variable address to the subprogram, so if you change the value in the subprogram, the changed value will still be changed when the calling program regains control. CALL BY CONTENT passes a copy of the variable to the subprogram, so if you change the value in the subprogram, you do NOT change the value when the calling program regains control.

Re: CALL by reference and content.

Posted: Mon Apr 21, 2014 3:54 pm
by Raunak Singh
Thanks Robert.