Actual parameters
When a subprogram is called, absolute values or variables (known as actual parameters) have
to be transferred to it.
As such, the actual parameters assign up-to-date values to the interface of the subprogram
when the latter is called.
Example:
Program code Comment
N10 DEF REAL WIDTH ; Variable definition
N20 WIDTH=20.0 ; Variable assignment
N30 CONTOUR(5.5, WIDTH) ; Subprogram call with actual parameters: 5.5
and WIDTH
...
N100 M30
3.2.1.6 Parameter transfer
Definition of a subprogram with parameter transfer
A subprogram with parameter transfer is defined using the PROC keyword and a complete list
of all the parameters expected by the subprogram.
Incomplete parameter transfer
When the subprogram is called, not all the parameters defined in the subprogram interface
have to be transferred explicitly. If a parameter is omitted, the default value "0" is transferred for
it.
So that the parameter sequence can be uniquely identified, however, the commas used as
parameter separators always have to be included. The last parameter is an exception. If it is
omitted from the call, the last comma can also be left out.
Example:
Subprogram:
Program code Comment
PROC SUB_PROG (REAL X, REAL Y, REAL Z) ; Formal parameters: X, Y, and Z
...
N100 RET
Main program:
Program code Comment
PROC MAIN_PROG
...
Work preparation
3.2 Subprogram technique
NC programming
494 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0