| |
NOMAD
7.50 - CALL-BY-VALUE |
 |
Call-by-value provides a means of calling procedures with the ability of passing
the values of &variables or any other expressions. The expressions are
evaluated when the procedure is called and assigned to receiving &variables
in the called procedure. Because the value of an &variable is passed to the
called procedure rather than a reference to the &variable itself, changes to
the receiving &variable in the called procedure do not cause modification to
the &variable in the called procedure.
Two new commands have been added. The CALLENTRY command calls a procedure,
passing the value of any expressions that it has as arguments. In the called
procedure, the ENTRY command receives the values, and assigns them to its
&variable arguments. All parameter passing is by assignment, following the
standard NOMAD assignment rules.
Example 1: Passing parameters through an &variable
 |
|
 |
| |
ENTSAMP NOMAD:
entry (&x);
print &x;
Output from interactive commands:
> &zot = 'HELLO'
> callentry entsamp (&zot)
&X=HELLO |
|
 |
|
 |
Note: that the value of &ZOT is passed by the CALLENTRY command.
 |
Learn
More |
 |
To find out more about how Select Business Solutions can help you either Contact
Us, or visit our Product Resources area for all the latest related
downloads.
|
 |
|