Subroutines, Macros
2.4 Call subroutines (L or EXTERN)
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
2-9
2.4 2.4 Call subroutines (L or EXTERN)
Function
Calling subroutines without parameter transfer
In the main program, you call the subroutine either
• with the L address and the subroutine number or
• with the program name.
Example:
N10 L47 or
N10 SPIGOT_2
1
1/
6XESURJUDP
RU
0DLQSURJUDP
6SLJRWB
Programming
Subroutine with parameter transfer, explanation of EXTERN
EXTERN
Subroutines with parameter transfer must be listed with EXTERN in the main program before
they are called, e.g., at the beginning of the program.
The name of the subroutine and the variable types are declared in the sequence in which
they are transferred, see example.
Subroutines with parameter transfer
In the main program you call the subroutine by specifying the program name and parameter
transfer. When transferring parameters you can transfer variables or values directly (not for
VAR parameters), see example.