Chapter 8 PAC Language Syntax
8-15
8.8.5 Calling Defined Process
If a part of a program that repeats a particular motion is separated, the part can
be called as it is required. This is referred to as a calling defined process.
For the calling defined process there are two kinds of calling; subroutine calling
and program calling.
[ 1 ] Subroutine
If a subroutine is called, designate a destination with a label in a GOSUB
statement.
The subroutine must be written in the same file as the program to be called.
The last line of the subroutine should have a RETURN statement. After a
series of processes are performed, the RETURN statement is executed and
control is returned to the next line in the program which called the subroutine.
Subroutine Calling Structure
Main routine
(Calling routine)
Subroutine
*SUBROUTINE:
*SUBROUTINE:
Comments to this Manuals