ESL subroutines perform in much the same way as action routines, except for the following distinctions:
•ESL subroutines can be declared and then referenced before they are defined. Action routines need not be declared or defined before they are referenced.
•ESL subroutines have an argument list as part of their syntax. This allows you to pass parameters to the subroutine in the form of variables, which must be previously declared in your program before being passed as arguments. The arguments passed must match those declared for the subroutine in type and number. Note that you cannot pass constants, literals, or arrays as arguments. The values of the argument list variables can be changed by the subroutine, and the new values will also be reflected by the value of the variable used as the argument, even outside of the subroutine. The argument list can contain a maximum of 13 arguments.
•ESL subroutines support the use of local variables. Thus, you can declare variables within a subroutine to be used by that subroutine only. You cannot define a constant within a subroutine. Storage space for local variables is allocated only when the subroutine is entered, and is freed when the subroutine has completed execution.